Skip to content

Commit

Permalink
chore(tooltip cypress steps): remove commented-out code
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammer5 committed Apr 24, 2024
1 parent e0f4caf commit e390c5b
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions components/tooltip/src/features/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,16 @@ Then('the Tooltip stays visible', () => {
cy.get('[data-test="dhis2-uicore-tooltip-content"]').should('exist')
})

Then('the Tooltip is rendered on top of the anchor', () => {
Then('the Tooltip is rendered on top of the anchor', async () => {
cy.get('[data-test="dhis2-uicore-tooltip-reference"]').then(($ref) => {
const refPos = $ref[0].getBoundingClientRect()

cy.get('[data-test="dhis2-uicore-tooltip-content"]').then(
($content) => {
const contentPos = $content[0].getBoundingClientRect()
expect(contentPos.bottom).to.be.greaterThan(refPos.top)
expect(refPos.top).to.be.greaterThan(contentPos.top)
}
)
})

// cy.getPositionsBySelectors(
// '[data-test="dhis2-uicore-tooltip-content"]',
// '[data-test="dhis2-uicore-tooltip-reference"]'
// ).should(([refPos, contentPos]) => {
// expect(contentPos.bottom).to.be.greaterThan(refPos.top)
// expect(refPos.top).to.be.greaterThan(contentPos.top)
// })
})

0 comments on commit e390c5b

Please sign in to comment.