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:
JasmineSun33
2021-12-08 22:27:43 -05:00
committed by GitHub
parent 471b2bf24f
commit d95226ff1d

View File

@ -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();
});
});