Skip to content

Commit

Permalink
test: add can edit form e2e tests (#3198)
Browse files Browse the repository at this point in the history
Co-authored-by: Santi-3rd <[email protected]>
  • Loading branch information
maiyerlee and Santi-3rd authored Dec 10, 2024
1 parent 92fbfc2 commit 4f5c8b3
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions frontend/cypress/e2e/canDetail.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { terminalLog, testLogin } from "./utils";

beforeEach(() => {
testLogin("system-owner");
testLogin("budget-team");
});

afterEach(() => {
Expand All @@ -11,13 +11,25 @@ afterEach(() => {
});

describe("CAN detail page", () => {
it("shows relevant CAN data", () => {
it("shows the CAN details page", () => {
cy.visit("/cans/502/");
cy.get("h1").should("contain", "G99PHS9"); // heading
cy.get("p").should("contain", "SSRD - 5 Years"); // sub-heading
cy.get("p").should("contain", "SSRD"); // sub-heading
cy.get("span").should("contain", "Nicole Deterding"); // team member
cy.get("span").should("contain", "Director Derrek"); // division director
cy.get("span").should("contain", "Program Support"); // portfolio
cy.get("span").should("contain", "Division of Data and Improvement"); // division
});
it.only("CAN Edit form", () => {
cy.visit("/cans/502/");
cy.get("#fiscal-year-select").select("2024");
cy.get("#edit").should("not.exist");
cy.get("#fiscal-year-select").select("2025"); //TODO: change to current fiscal year
cy.get("#edit").should("exist");
cy.get("#edit").click();
cy.get("h2").should("contain", "Edit CAN Details");
cy.get("#can_nick_name", "input").should("contain", "SSRD");
cy.get("#can_nick_name").type("Test Can Nickname");
});
it("shows the CAN Spending page", () => {
cy.visit("/cans/504/spending");
Expand Down

0 comments on commit 4f5c8b3

Please sign in to comment.