Skip to content

Commit

Permalink
e2e test done
Browse files Browse the repository at this point in the history
  • Loading branch information
farzaneh-haghani committed Jun 1, 2024
1 parent 549ff1c commit b282841
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions e2e/integration/drafts.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,21 @@ it("lets admin users approve drafts", () => {
);
cy.findByRole("link", { name: /drafts/i }).should("not.exist");
});

it("lets admin users reject drafts", () => {
const adminEmail = "[email protected]";
cy.seed("admin");
cy.seed("oneDraftResource");
cy.visit("/");

cy.logInAs(adminEmail);
cy.findByRole("link", { name: /drafts/i }).click();
cy.findByText("Joi documentation").should("exist");
cy.findByRole("button", { name: /reject/i }).click();
cy.findByText("Joi documentation").should("not.exist");
cy.logOut();
cy.logInAs("[email protected]");
cy.findByRole("heading", { level: 3 }).should("not.exist");
cy.findByRole("link", { name: "joi.dev" }).should("not.exist");
cy.findByRole("link", { name: /drafts/i }).should("not.exist");
});

0 comments on commit b282841

Please sign in to comment.