Skip to content

Commit

Permalink
add testing of admin button
Browse files Browse the repository at this point in the history
  • Loading branch information
trstngttschlk committed Aug 22, 2023
1 parent bc8e9a5 commit fc39cf3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cypress/e2e/landing.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
import tgt from "../support/tgt";

describe("Landing", () => {
it("Admin links to adminDashboard", () => {
cy.visit("/");
tgt.nav.button.admin().click();
cy.url().should("eq", Cypress.config().baseUrl + "/adminDashboard");
});

it("Home links to home", () => {
cy.visit("/");
tgt.nav.button.home().click();
Expand Down
2 changes: 2 additions & 0 deletions cypress/support/tgt.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export default {
},
landing: {
button: {
admin: () => cy.contains("button", "Admin"),
calendar: () => cy.contains("button", "Calendar"),
},
},
Expand All @@ -85,6 +86,7 @@ export default {
},
nav: {
button: {
admin: () => cy.contains("button", "Admin"),
home: () => cy.contains("button", "Home"),
calendar: () => cy.contains("button", "Calendar"),
},
Expand Down

0 comments on commit fc39cf3

Please sign in to comment.