diff --git a/packages/react-notifications/jest.config.ts b/packages/react-notifications/jest.config.ts index 7c4e157769e..1f7577b641b 100644 --- a/packages/react-notifications/jest.config.ts +++ b/packages/react-notifications/jest.config.ts @@ -9,26 +9,14 @@ const config: Config = { // do not collect from top level styles file '!/src/styles.ts', ], - // coverageThreshold: { - // global: { - // branches: 80, - // functions: 80, - // lines: 80, - // statements: 80, - // }, - // }, coverageThreshold: { global: { - branches: 67.18, - functions: 52.08, - lines: 58.19, - statements: 58.46, + branches: 95, + functions: 93, + lines: 95, + statements: 95, }, }, - // @todo-migration update test API usage and remove temp thresholds - testPathIgnorePatterns: [ - '/src/components/InAppMessaging/MessageLayout/__tests__/MessageLayout.test.tsx', - ], moduleNameMapper: { '^uuid$': '/../../node_modules/uuid' }, modulePathIgnorePatterns: ['/dist/'], preset: 'ts-jest', diff --git a/packages/react-notifications/src/components/InAppMessaging/MessageLayout/__tests__/MessageLayout.test.tsx b/packages/react-notifications/src/components/InAppMessaging/MessageLayout/__tests__/MessageLayout.test.tsx index df9116d851f..ce439b36bdf 100644 --- a/packages/react-notifications/src/components/InAppMessaging/MessageLayout/__tests__/MessageLayout.test.tsx +++ b/packages/react-notifications/src/components/InAppMessaging/MessageLayout/__tests__/MessageLayout.test.tsx @@ -124,11 +124,11 @@ describe('MessageLayout component', () => { expect(textContainer).toHaveClass(`${TEXT_CONTAINER_CLASS}--horizontal`); }); - it('should trigger onClose function', () => { + it('should trigger onClose function', async () => { render(); const closeButton = screen.getByRole('button'); - userEvent.click(closeButton); + await userEvent.click(closeButton); expect(mockOnClose).toHaveBeenCalled(); }); @@ -172,7 +172,7 @@ describe('MessageLayout component', () => { ); }); - it('should trigger the button onAction functions', () => { + it('should trigger the button onAction functions', async () => { render( { /> ); - userEvent.click(screen.getByText(PRIMARY_BUTTON)); + await userEvent.click(screen.getByText(PRIMARY_BUTTON)); expect(mockPrimaryButtonOnAction).toHaveBeenCalled(); expect(mockSecondaryButtonOnAction).not.toHaveBeenCalled(); - userEvent.click(screen.getByText(SECONDARY_BUTTON)); + + await userEvent.click(screen.getByText(SECONDARY_BUTTON)); expect(mockSecondaryButtonOnAction).toHaveBeenCalled(); });