From 01da484a7a4686c39b66a5469fee3c452980259d Mon Sep 17 00:00:00 2001 From: Kevin He Date: Fri, 12 May 2023 15:09:39 -0700 Subject: [PATCH] add test to reach test coverage threshold --- .../universal/components/app-error-boundary/index.test.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/pwa-kit-react-sdk/src/ssr/universal/components/app-error-boundary/index.test.js b/packages/pwa-kit-react-sdk/src/ssr/universal/components/app-error-boundary/index.test.js index 15782d4b97..b352538e2d 100644 --- a/packages/pwa-kit-react-sdk/src/ssr/universal/components/app-error-boundary/index.test.js +++ b/packages/pwa-kit-react-sdk/src/ssr/universal/components/app-error-boundary/index.test.js @@ -75,4 +75,12 @@ describe('AppErrorBoundary', () => { const result = AppErrorBoundary.getDerivedStateFromError(error) expect(result.error.message).toEqual(error.toString()) }) + + test(`componentWillUnmount unlistens to history`, () => { + const unlisten = jest.fn() + const history = {listen: jest.fn().mockReturnValue(unlisten)} + const wrapper = mount(test) + wrapper.unmount() + expect(unlisten).toBeCalled() + }) })