Vagr9K/gatsby-material-starter

View on GitHub
examples/material-demo/cypress/e2e/navigation.test.ts

Summary

Maintainability
A
2 hrs
Test Coverage
describe(`main navigation`, () => {
  beforeEach(() => {
    cy.visit("/big-sample-test");
    cy.waitForRouteChange();
  });

  it("has a clickable logo", () => {
    cy.get("header").findAllByText("Material Blog").click();

    cy.location("pathname").should("eq", "/");
  });

  it("has a Posts link", () => {
    cy.get("header").findAllByText("Posts").click();

    cy.location("pathname").should("eq", "/");
  });

  it("has an About link", () => {
    cy.get("header").findAllByText("About").click();

    cy.url().should("include", "/about");
  });
});