File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ function StyledSelect({
2020 id = { id }
2121 value = { value }
2222 onChange = { ( e ) => onChange ( e . target . value ) }
23- className = "w-full bg-gray-100/80 backdrop-blur-md border border-black/10 dark:bg-white/[0.03] dark:border-white/10 rounded-xl px-4 py-2.5 text-sm text-black dark:text-white outline-none focus:border-emerald-500/50 transition-colors appearance-none cursor-pointer"
23+ className = "w-full bg-gray-100/80 backdrop-blur-md border border-black/10 dark:bg-white/[0.03] dark:border-white/10 rounded-xl px-4 py-2.5 text-sm text-black dark:text-white outline-none focus:border-emerald-500/50 transition-colors appearance-none cursor-pointer [color-scheme:light] dark:[color-scheme:dark] [&>option]:bg-white [&>option]:text-black dark:[&>option]:bg-[#0a0a0a] dark:[&>option]:text-white "
2424 >
2525 { children }
2626 </ select >
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ vi.mock('framer-motion', () => ({
5252
5353vi . mock ( '@/hooks/useRecentSearches' , ( ) => ( {
5454 useRecentSearches : ( ) => ( {
55- searches : [ ] ,
55+ searches : [ 'octocat' , 'torvalds' ] ,
5656 addSearch : vi . fn ( ) ,
5757 clearSearches : vi . fn ( ) ,
5858 } ) ,
@@ -100,6 +100,19 @@ describe('LandingPage', () => {
100100 expect ( input . value ) . toBe ( '' ) ;
101101 } ) ;
102102
103+ it ( 'renders recent searches and applies a recent search when clicked' , ( ) => {
104+ render ( < LandingPage /> ) ;
105+ const input = screen . getByPlaceholderText ( 'Enter GitHub Username' ) as HTMLInputElement ;
106+ const octocatButton = screen . getByRole ( 'button' , { name : 'octocat' } ) ;
107+
108+ expect ( octocatButton ) . toBeDefined ( ) ;
109+ expect ( screen . getByRole ( 'button' , { name : 'Clear' } ) ) . toBeDefined ( ) ;
110+
111+ fireEvent . click ( octocatButton ) ;
112+
113+ expect ( input . value ) . toBe ( 'octocat' ) ;
114+ } ) ;
115+
103116 it ( 'renders an empty state before a username is entered' , ( ) => {
104117 render ( < LandingPage /> ) ;
105118
You can’t perform that action at this time.
0 commit comments