File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed
Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,27 @@ function App() {
120120 className = "hidden"
121121 />
122122 </ div >
123+ < div className = "mt-3 text-center print:hidden" >
124+ < p className = "text-sm text-gray-500 mb-2" > If you like the app, please support the author with bread & beer:</ p >
125+ < div className = "flex gap-2 justify-center" >
126+ < a
127+ href = "https://github.com/sponsors/nolar/"
128+ target = "_blank"
129+ rel = "noopener noreferrer"
130+ className = "rounded bg-gray-100 px-3 py-1.5 text-sm font-medium text-gray-700 hover:bg-gray-200"
131+ >
132+ Sponsor via GitHub
133+ </ a >
134+ < a
135+ href = "https://paypal.me/nolarinfo"
136+ target = "_blank"
137+ rel = "noopener noreferrer"
138+ className = "rounded bg-gray-100 px-3 py-1.5 text-sm font-medium text-gray-700 hover:bg-gray-200"
139+ >
140+ Sponsor via PayPal
141+ </ a >
142+ </ div >
143+ </ div >
123144 </ main >
124145 < aside className = "w-64 shrink-0 print:hidden" >
125146 < DateForm
Original file line number Diff line number Diff line change @@ -58,6 +58,23 @@ describe("App", () => {
5858 expect ( downloadBtn . parentElement ! . className ) . toContain ( "print:hidden" ) ;
5959 } ) ;
6060
61+ it ( "renders sponsor links with correct hrefs" , ( ) => {
62+ render ( < MemoryRouter > < App /> </ MemoryRouter > ) ;
63+
64+ const github = screen . getByRole ( "link" , { name : "Sponsor via GitHub" } ) ;
65+ expect ( github ) . toHaveAttribute ( "href" , "https://github.com/sponsors/nolar/" ) ;
66+ expect ( github ) . toHaveAttribute ( "target" , "_blank" ) ;
67+
68+ const paypal = screen . getByRole ( "link" , { name : "Sponsor via PayPal" } ) ;
69+ expect ( paypal ) . toHaveAttribute ( "href" , "https://paypal.me/nolarinfo" ) ;
70+ expect ( paypal ) . toHaveAttribute ( "target" , "_blank" ) ;
71+ } ) ;
72+
73+ it ( "renders sponsor intro text" , ( ) => {
74+ render ( < MemoryRouter > < App /> </ MemoryRouter > ) ;
75+ expect ( screen . getByText ( / s u p p o r t t h e a u t h o r w i t h b r e a d & b e e r / ) ) . toBeInTheDocument ( ) ;
76+ } ) ;
77+
6178 it ( "applies print layout classes to root containers" , ( ) => {
6279 const { container } = render ( < MemoryRouter > < App /> </ MemoryRouter > ) ;
6380 const root = container . firstElementChild ! ;
You can’t perform that action at this time.
0 commit comments