Skip to content

Commit

Permalink
added test to check action buttons within viewport
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Dawson committed Aug 10, 2023
1 parent 01770d3 commit 10a1ea8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/e2e/specs/mutation.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,19 @@ describe('Mutations component', () => {
.get('@errTooltip')
.should('not.have.css', 'display', 'none')
})
it.only('should display action buttons within viewport', () => {
mockMutations()
openMutationsForm('checkpoint')
cy.get('.v-card-actions').eq(0).then(($el) => {
console.log('element', $el[0])
const rect = $el[0].getBoundingClientRect() // https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect
const isInViewport = (
rect.top >= -2 &&
rect.left >= 0 &&
rect.bottom <= Cypress.$(cy.state('window')).height() &&
rect.right <= Cypress.$(cy.state('window')).width()
)
expect(isInViewport).to.be.true
})
})
})

0 comments on commit 10a1ea8

Please sign in to comment.