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 React from 'react';
|
||||||
import ShallowRenderer from 'react-test-renderer/shallow';
|
import { createRenderer } from 'react-test-renderer/shallow';
|
||||||
|
|
||||||
import mockChallengeNodes from '../../__mocks__/challenge-nodes';
|
import mockChallengeNodes from '../../__mocks__/challenge-nodes';
|
||||||
import IndexPage from '../../pages';
|
import IndexPage from '../../pages';
|
||||||
@ -8,9 +8,11 @@ jest.mock('../../analytics');
|
|||||||
|
|
||||||
describe('<Landing />', () => {
|
describe('<Landing />', () => {
|
||||||
it('renders when visiting index page and logged out', () => {
|
it('renders when visiting index page and logged out', () => {
|
||||||
const shallow = new ShallowRenderer();
|
const utils = createRenderer();
|
||||||
shallow.render(<IndexPage {...loggedOutProps} />);
|
// @ts-expect-error Type definition mismatch
|
||||||
const view = shallow.getRenderOutput();
|
utils.render(<IndexPage {...loggedOutProps} />);
|
||||||
|
const view = utils.getRenderOutput();
|
||||||
|
// @ts-expect-error Type definition mismatch
|
||||||
expect(view.type.displayName === 'Landing').toBeTruthy();
|
expect(view.type.displayName === 'Landing').toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
Reference in New Issue
Block a user