chore(client): migrate landing.test.js to ts (#43889)
* rename file * disable lint * change to specific annotation * kebaberise file name * adjust naming to remove need for eslint-disable Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import ShallowRenderer from 'react-test-renderer/shallow';
|
||||
import { createRenderer } from 'react-test-renderer/shallow';
|
||||
|
||||
import mockChallengeNodes from '../../__mocks__/challenge-nodes';
|
||||
import IndexPage from '../../pages';
|
||||
@ -8,9 +8,11 @@ jest.mock('../../analytics');
|
||||
|
||||
describe('<Landing />', () => {
|
||||
it('renders when visiting index page and logged out', () => {
|
||||
const shallow = new ShallowRenderer();
|
||||
shallow.render(<IndexPage {...loggedOutProps} />);
|
||||
const view = shallow.getRenderOutput();
|
||||
const utils = createRenderer();
|
||||
// @ts-expect-error Type definition mismatch
|
||||
utils.render(<IndexPage {...loggedOutProps} />);
|
||||
const view = utils.getRenderOutput();
|
||||
// @ts-expect-error Type definition mismatch
|
||||
expect(view.type.displayName === 'Landing').toBeTruthy();
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user