Skip to content

Commit

Permalink
add test for mobile menu
Browse files Browse the repository at this point in the history
  • Loading branch information
ekraffmiller committed Aug 10, 2023
1 parent a6d3191 commit a093a00
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
23 changes: 23 additions & 0 deletions client/cypress/e2e/home-page.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')

})
})
}
3 changes: 2 additions & 1 deletion client/src/components/Structure/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<v-spacer></v-spacer>

<v-app-bar-nav-icon
data-test="menuIcon"
@click.stop="isDrawerActive = !isDrawerActive"
class="hidden-md-and-up"
></v-app-bar-nav-icon>
Expand Down Expand Up @@ -102,7 +103,7 @@
>
</div>
</v-container>
<v-list nav class="mobile-menu-list">
<v-list data-test="mobileMenu" nav class="mobile-menu-list">
<v-list-item
v-for="(item, index) in mobileMenu"
:key="item.title + '-' + index"
Expand Down

0 comments on commit a093a00

Please sign in to comment.