You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-06-17 08:42:02 +03:00
Remove Enzyme tests in favour of React testing-library (#10289)
This commit is contained in:
committed by
GitHub
parent
303b878b17
commit
667ec166d7
@ -31,19 +31,19 @@ const %%ComponentName%%: React.FC<Props> = () => {
|
||||
export default %%ComponentName%%;
|
||||
`,
|
||||
TEST: `
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import React from "react";
|
||||
import { render } from "@testing-library/react";
|
||||
|
||||
import %%ComponentName%% from '%%RelativeComponentPath%%';
|
||||
|
||||
describe('<%%ComponentName%% />', () => {
|
||||
describe("<%%ComponentName%% />", () => {
|
||||
const defaultProps = {};
|
||||
const getComponent = (props = {}) =>
|
||||
mount(<%%ComponentName%% {...defaultProps} {...props} />);
|
||||
render(<%%ComponentName%% {...defaultProps} {...props} />);
|
||||
|
||||
it('renders', () => {
|
||||
const component = getComponent();
|
||||
expect(component).toBeTruthy();
|
||||
it("matches snapshot", () => {
|
||||
const { asFragment } = getComponent();
|
||||
expect(asFragment()).toMatchSnapshot()();
|
||||
});
|
||||
});
|
||||
`,
|
||||
|
Reference in New Issue
Block a user