File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -311,4 +311,29 @@ describe('DashboardClient', () => {
311311 expect ( screen . getByText ( / C a n n o t c o m p a r e a p r o f i l e w i t h i t s e l f / i) ) . toBeDefined ( ) ;
312312 } ) ;
313313 } ) ;
314+
315+ // =========================================================================
316+ // ISSUE OBJECTIVE #1063: Verify compare modal input can be cleared
317+ // =========================================================================
318+ it ( 'verify compare modal input can be cleared' , async ( ) => {
319+ render ( < DashboardClient initialData = { mockInitialData } username = "Shivangi1515" /> ) ;
320+
321+ // 1. Open modal
322+ const compareBtn = screen . getByText ( 'Compare Profile' ) ;
323+ fireEvent . click ( compareBtn ) ;
324+
325+ // 2. Type a username into the input
326+ const input = screen . getByPlaceholderText ( 'Enter GitHub Username' ) ;
327+ fireEvent . change ( input , { target : { value : 'testuser' } } ) ;
328+
329+ // 3. Assert 'Clear input' (aria-label) button appears
330+ const clearButton = screen . getByRole ( 'button' , { name : 'Clear input' } ) ;
331+ expect ( clearButton ) . toBeDefined ( ) ;
332+
333+ // 4. Click clear button
334+ fireEvent . click ( clearButton ) ;
335+
336+ // 5. Assert input value is empty
337+ expect ( ( input as HTMLInputElement ) . value ) . toBe ( '' ) ;
338+ } ) ;
314339} ) ;
You can’t perform that action at this time.
0 commit comments