Skip to content

Commit

Permalink
changed some changes in OrganizationScreen.test.tsx file
Browse files Browse the repository at this point in the history
  • Loading branch information
gurramkarthiknetha committed Dec 9, 2024
1 parent d8f0951 commit cc4582c
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/components/OrganizationScreen/OrganizationScreen.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit cc4582c

Please sign in to comment.