You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-22 18:41:57 +03:00
Convert some tests from Enzyme to RTL (#9483)
This commit is contained in:
committed by
GitHub
parent
9eb4f8d723
commit
913af09e61
@ -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 { TextInputField } from "@matrix-org/react-sdk-module-api/lib/components/TextInputField";
|
||||
import { Spinner as ModuleSpinner } from "@matrix-org/react-sdk-module-api/lib/components/Spinner";
|
||||
|
||||
@ -31,12 +30,12 @@ describe("Module Components", () => {
|
||||
// ModuleRunner import to do its job (as per documentation in ModuleComponents).
|
||||
|
||||
it("should override the factory for a TextInputField", () => {
|
||||
const component = mount(<TextInputField label="My Label" value="My Value" onChange={() => {}} />);
|
||||
expect(component).toMatchSnapshot();
|
||||
const { asFragment } = render(<TextInputField label="My Label" value="My Value" onChange={() => {}} />);
|
||||
expect(asFragment()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("should override the factory for a ModuleSpinner", () => {
|
||||
const component = mount(<ModuleSpinner />);
|
||||
expect(component).toMatchSnapshot();
|
||||
const { asFragment } = render(<ModuleSpinner />);
|
||||
expect(asFragment()).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user