import * as React from 'react' ; import { createTestComponent , validToken } from '@client/tests/util' ; import { createStore } from '@client/store' ; import { checkAuth } from '@client/profile/profileActions' ; import { SetupConfirmationPage } from '@client/views/UserSetup/SetupConfirmationPage' ; const getItem = window . localStorage . getItem as jest . Mock ; describe ( 'Setup confirmation page tests' , ( ) => { const { store } = createStore ( ) ; beforeAll ( async ( ) => { getItem . mockReturnValue ( validToken ) ; await store . dispatch ( checkAuth ( { '?token' : validToken } ) ) ; } ) ; it ( 'renders page successfully' , async ( ) => { const testComponent = await createTestComponent ( < SetupConfirmationPage />, store); const app = testComponent . component ; expect ( app . find ( '#user-setup-complete-page' ) . hostNodes ( ) ) . toHaveLength ( 1 ) ; } ) ; } ) ;