diff --git a/packages/storage-ui/cypress/support/page-objects/navigationMenu.ts b/packages/storage-ui/cypress/support/page-objects/navigationMenu.ts index 058031ac53..266ce5ae02 100644 --- a/packages/storage-ui/cypress/support/page-objects/navigationMenu.ts +++ b/packages/storage-ui/cypress/support/page-objects/navigationMenu.ts @@ -9,5 +9,5 @@ export const navigationMenu = { spaceUsedLabel: () => cy.get("[data-cy=label-space-used]"), spaceUsedProgressBar: () => cy.get("[data-cy=progress-bar-space-used]"), // mobile view only - signOutButton: () => cy.get("[data-cy=container-signout-nav]") + signOutButton: () => cy.get("[data-cy=button-sign-out]") } diff --git a/packages/storage-ui/cypress/tests/main-navigation-spec.ts b/packages/storage-ui/cypress/tests/main-navigation-spec.ts index 2133ad3e98..c3e8bda5d3 100644 --- a/packages/storage-ui/cypress/tests/main-navigation-spec.ts +++ b/packages/storage-ui/cypress/tests/main-navigation-spec.ts @@ -1,10 +1,11 @@ import { navigationMenu } from "../support/page-objects/navigationMenu" import { cidsPage } from "../support/page-objects/cidsPage" +import { authenticationPage } from "../support/page-objects/authenticationPage" describe("Main Navigation", () => { context("desktop", () => { - before(() => { + beforeEach(() => { cy.web3Login() }) @@ -12,14 +13,22 @@ describe("Main Navigation", () => { navigationMenu.cidsNavButton().click() cy.url().should("include", "/cids") }) - }) - context("mobile", () => { - before(() => { - cy.web3Login() + it("can sign out from the navigation bar", () => { + navigationMenu.signOutDropdown().click() + navigationMenu.signOutMenuOption() + .should("be.visible") + .click() + authenticationPage.web3Button().should("be.visible") + cy.url().should("not.include", "/drive") + cy.url().should("not.include", "/bin") + cy.url().should("not.include", "/settings") }) + }) + context("mobile", () => { beforeEach(() => { + cy.web3Login() cy.viewport("iphone-6") cidsPage.hamburgerMenuButton().click() }) @@ -28,5 +37,15 @@ describe("Main Navigation", () => { navigationMenu.cidsNavButton().click() cy.url().should("include", "/cids") }) + + it("can sign out from the navigation bar", () => { + navigationMenu.signOutButton() + .should("be.visible") + .click() + authenticationPage.web3Button().should("be.visible") + cy.url().should("not.include", "/drive") + cy.url().should("not.include", "/bin") + cy.url().should("not.include", "/settings") + }) }) }) diff --git a/packages/storage-ui/src/Components/Layouts/AppNav.tsx b/packages/storage-ui/src/Components/Layouts/AppNav.tsx index 3fb78fe4a2..cc5e89d667 100644 --- a/packages/storage-ui/src/Components/Layouts/AppNav.tsx +++ b/packages/storage-ui/src/Components/Layouts/AppNav.tsx @@ -337,6 +337,7 @@ const AppNav: React.FC = ({ navOpen, setNavOpen }: IAppNav) => {