Skip to content

Commit

Permalink
add uncertify step to test
Browse files Browse the repository at this point in the history
  • Loading branch information
britt-mo committed Jul 20, 2023
1 parent 8f55be5 commit 99df1f2
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions tests/cypress/tests/integration/submitAndUncertify.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,30 @@ const uncertifyButton = "[data-testid='uncertifyButton']";
describe("CARTS Submit and Uncertify Integration Tests", () => {
before(() => {
cy.visit("/");
});

it("Should submit form as a State User and uncertify as a Reviewer", () => {
// generate the forms
// login as admin
cy.authenticate("adminUser");
/*
* check if there is a certified program, if so, uncertify
* so state user will always have an editable program
*/
cy.wait(15000);

cy.get("body").then(($body) => {
if ($body.text().includes("Uncertify")) {
cy.wait(3000);
cy.get(uncertifyButton).first().click();
cy.get("button").contains("Yes, Uncertify").click();
}
return;
});

cy.wait(3000);
cy.get(headerDropdownMenu).click();
cy.get(logoutButton).click();
});

it("Should submit form as a State User and uncertify as a Reviewer", () => {
// log in as State User
cy.authenticate("stateUser");

Expand All @@ -30,8 +46,8 @@ describe("CARTS Submit and Uncertify Integration Tests", () => {
cy.get(headerDropdownMenu).click();
cy.get(logoutButton).click();

// log in as CMS User (Reviewer)
cy.authenticate("reviewer");
// log in as CMS Admin (user who can uncertify)
cy.authenticate("adminUser");

// uncertify report
cy.get(uncertifyButton).first().contains("Uncertify").click();
Expand Down

0 comments on commit 99df1f2

Please sign in to comment.