Migrate some tests to React Testing Library (#9584)

This commit is contained in:
Germain 2022-11-18 09:16:11 +00:00 committed by GitHub
parent ef548a4843
commit 38dbe8ed33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 325 additions and 527 deletions

View file

@ -15,8 +15,7 @@ limitations under the License.
*/
import React from 'react';
// eslint-disable-next-line deprecate/import
import { mount } from "enzyme";
import { render } from '@testing-library/react';
import * as TestUtils from "../../../test-utils";
import FontScalingPanel from '../../../../src/components/views/settings/FontScalingPanel';
@ -34,9 +33,9 @@ jest.mock(
describe('FontScalingPanel', () => {
it('renders the font scaling UI', () => {
TestUtils.stubClient();
const wrapper = mount(
const { asFragment } = render(
<FontScalingPanel />,
);
expect(wrapper).toMatchSnapshot();
expect(asFragment()).toMatchSnapshot();
});
});