File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -265,31 +265,29 @@ describe('NavBar Component', () => {
265
265
console . log ( 'After rendering NavBar' ) ;
266
266
267
267
await act ( async ( ) => {
268
- // Initially, the dropdown should have the "hideNavDropDown" class
268
+
269
269
const dropdownMenu = getByTestId ( 'navDropDown' ) ;
270
270
expect ( dropdownMenu ) . toHaveClass ( 'hideNavDropDown' ) ;
271
271
272
- // Find and click the button to open the dropdown
272
+
273
273
const moreVertButton = getByTestId ( 'more-vert-button' ) ;
274
274
fireEvent . click ( moreVertButton ) ;
275
275
276
- // After clicking, the dropdown should have the "navDropDown" class
276
+
277
277
expect ( dropdownMenu ) . toHaveClass ( 'hideNavDropDown' ) ;
278
278
279
- // Clear canvas click
279
+
280
280
const clearCanvasMenuItem = getByText ( 'Clear Canvas' ) ;
281
281
fireEvent . click ( clearCanvasMenuItem ) ;
282
282
expect ( dropdownMenu ) . toHaveClass ( 'hideNavDropDown' ) ;
283
283
284
- // After clicking "Marketplace", it should remain open
284
+
285
285
const marketplaceMenuItem = getByText ( 'Marketplace' ) ;
286
286
fireEvent . click ( marketplaceMenuItem ) ;
287
287
expect ( dropdownMenu ) . toHaveClass ( 'hideNavDropDown' ) ;
288
288
289
- // Close the dropdown by clicking the button again
290
289
fireEvent . click ( moreVertButton ) ;
291
290
292
- // After closing, the dropdown should have the "hideNavDropDown" class
293
291
expect ( dropdownMenu ) . toHaveClass ( 'hideNavDropDown' ) ;
294
292
} ) ;
295
293
} ) ;
You can’t perform that action at this time.
0 commit comments