8
3. Make tests easy to read and write
describe(“Form”, () => {
it(“should render the form”, () => {
cy.mock(UserAPI.getUser, { email: ‘
[email protected]’ });
cy.getByTestId(“testForm”)
.assertTextInput(“Email”, “
[email protected]”, { placeholder: “Email” })
.assertSelect(“True/False”, null, { values: [“True”, “False”] })
.assertButton(“Confirm”);
});
});
Tests that are easy to read and write will be maintained better, and
used more than those that are not.