From a093a00f5415ae6bbbb0a7f79f81f2fee075db94 Mon Sep 17 00:00:00 2001 From: Ellen Kraffmiller Date: Thu, 10 Aug 2023 09:29:06 -0400 Subject: [PATCH] add test for mobile menu --- client/cypress/e2e/home-page.cy.js | 23 ++++++++++++++++++++++ client/src/components/Structure/Header.vue | 3 ++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/client/cypress/e2e/home-page.cy.js b/client/cypress/e2e/home-page.cy.js index f3ea248c..c7c164e9 100644 --- a/client/cypress/e2e/home-page.cy.js +++ b/client/cypress/e2e/home-page.cy.js @@ -20,4 +20,27 @@ .should('contain', 'A differentially private (DP) Release includes the statistic or statistics that you have requested. ') }) }) + describe('The Home Page', () => { + it('correctly renders hamburger menu', () => { + cy.clearData() + cy.on('uncaught:exception', (e, runnable) => { + console.log('error', e) + console.log('runnable', runnable) + + return false + }) + const username = 'oscar' + const email = 'oscar@thegrouch.com' + const password = 'oscar123!' + cy.createAccount(username, email, password) + cy.viewport('ipad-mini') + + cy.visit('/') + cy.get('[data-test="menuIcon"]').should('be.visible') + cy.get('[data-test="menuIcon"]').click({force: true}) + cy.get('[data-test="mobileMenu"]').should('be.visible') + cy.get('[data-test="mobileMenu"]').should('include.text', 'My Analysis Plans') + + }) + }) } \ No newline at end of file diff --git a/client/src/components/Structure/Header.vue b/client/src/components/Structure/Header.vue index fc12250d..e72cf1a4 100644 --- a/client/src/components/Structure/Header.vue +++ b/client/src/components/Structure/Header.vue @@ -29,6 +29,7 @@ @@ -102,7 +103,7 @@ > - +