From 09b536309e56ed1fa18b7b0acb2ece7c41ac6588 Mon Sep 17 00:00:00 2001 From: tim Date: Thu, 30 Nov 2023 21:37:21 +0800 Subject: [PATCH] update test for LeftDrawerEventWrapper.tsx to 100% coverage --- .../LeftDrawerEvent/LeftDrawerEventWrapper.test.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/LeftDrawerEvent/LeftDrawerEventWrapper.test.tsx b/src/components/LeftDrawerEvent/LeftDrawerEventWrapper.test.tsx index 72093aaf06..cfcd380cb4 100644 --- a/src/components/LeftDrawerEvent/LeftDrawerEventWrapper.test.tsx +++ b/src/components/LeftDrawerEvent/LeftDrawerEventWrapper.test.tsx @@ -76,7 +76,7 @@ afterEach(() => { describe('Testing Left Drawer Wrapper component for the Event Dashboard', () => { test('Component should be rendered properly and the close menu button should function', async () => { - const { queryByText, queryByTestId } = render( + const { queryByText, getByTestId } = render( @@ -86,9 +86,15 @@ describe('Testing Left Drawer Wrapper component for the Event Dashboard', () => ); + const pageContainer = getByTestId('mainpageright'); + expect(pageContainer.className).toMatch(/pageContainer/i); + fireEvent.click(getByTestId('closeLeftDrawerBtn') as HTMLElement); + expect(pageContainer.className).toMatch(/expand/i); + fireEvent.click(getByTestId('closeLeftDrawerBtn') as HTMLElement); + expect(pageContainer.className).toMatch(/contract/i); + await waitFor(() => expect(queryByText('Event Management')).toBeInTheDocument() ); - fireEvent.click(queryByTestId('closeLeftDrawerBtn') as HTMLElement); }); });