From 2f69f6a95228d6f49fafe9dd326813029820f063 Mon Sep 17 00:00:00 2001 From: Alex Vuong Date: Mon, 15 May 2023 13:34:22 -0700 Subject: [PATCH] address feedback --- .../src/ssr/universal/components/_document/index.test.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/pwa-kit-react-sdk/src/ssr/universal/components/_document/index.test.js b/packages/pwa-kit-react-sdk/src/ssr/universal/components/_document/index.test.js index 0e48b24698..ac2fa5dee6 100644 --- a/packages/pwa-kit-react-sdk/src/ssr/universal/components/_document/index.test.js +++ b/packages/pwa-kit-react-sdk/src/ssr/universal/components/_document/index.test.js @@ -34,10 +34,15 @@ describe('Document', () => { // by default, React Testing Library append the test component into a body tag, since our component is a full DOM // there will be two body tags in the DOM, we only want to check the second one const bodyTag = document.querySelectorAll('body')[1] + // it looks like it returns two html collection, the first one is the React Testing library, the second one is our component we are testing + const htmlTag = document.getElementsByTagName('html')[1] + screen.debug() + console.log('htmlTag', Object.assign({}, htmlTag)) expect(svgTag).toBeInTheDocument() expect(scriptTag).toBeInTheDocument() expect(styleTag).toBeInTheDocument() expect(screen.getByText(/hello world/i)).toBeInTheDocument() expect(bodyTag).toHaveAttribute('class', 'root') + expect(htmlTag).toHaveAttribute('lang', 'en') }) })