/// import { before } from "lodash"; describe("Top Navigation", () => { const showSubscribeToUpdates = () => { cy.contains('Keep JamKazam Improving').should('exist') cy.contains('Subscribe') } describe("when user has not logged in", () => { beforeEach(() => { cy.stubUnauthenticate() cy.visit('/') }); it("does not show user dropdown", () => { showSubscribeToUpdates() cy.get('[data-testid=navbarTopProfileDropdown]').should('not.exist') }); }) describe("when user has logged in", () => { beforeEach(() => { cy.stubAuthenticate() cy.visit('/') }); it("shows user dropdown", () => { showSubscribeToUpdates() cy.get('[data-testid=navbarTopProfileDropdown]').should('exist') cy.contains("Peter Pan").should('exist') cy.contains("My Profile").should('exist') cy.contains("Sign out").should('exist') }) }) });