From cc4582c3051fcb024159676fbe97c8c2b22b8b02 Mon Sep 17 00:00:00 2001 From: gurramkarthiknetha Date: Tue, 10 Dec 2024 03:12:02 +0530 Subject: [PATCH] changed some changes in OrganizationScreen.test.tsx file --- .../OrganizationScreen.test.tsx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/components/OrganizationScreen/OrganizationScreen.test.tsx b/src/components/OrganizationScreen/OrganizationScreen.test.tsx index cd039cc3ca..cc707a6922 100644 --- a/src/components/OrganizationScreen/OrganizationScreen.test.tsx +++ b/src/components/OrganizationScreen/OrganizationScreen.test.tsx @@ -74,22 +74,26 @@ describe('Testing OrganizationScreen', () => { }); }); - test('handles drawer toggle correctly', () => { + test('handles drawer toggle correctly', async () => { renderComponent(); const closeButton = screen.getByTestId('closeMenu'); fireEvent.click(closeButton); - // Check for contract class after closing - expect(screen.getByTestId('mainpageright')).toHaveClass('_expand_ccl5z_8'); + // Check for expand class after closing + await waitFor(() => { + const mainPageRight = screen.getByTestId('mainpageright'); + expect(mainPageRight).toHaveClass(styles.expand); + }); const openButton = screen.getByTestId('openMenu'); fireEvent.click(openButton); - // Check for expand class after opening - expect(screen.getByTestId('mainpageright')).toHaveClass( - '_contract_ccl5z_61', - ); + // Check for contract class after opening + await waitFor(() => { + const mainPageRight = screen.getByTestId('mainpageright'); + expect(mainPageRight).toHaveClass(styles.contract); + }); }); test('handles window resize', () => {