Skip to content

Commit

Permalink
test(select): check clear button tooltip text
Browse files Browse the repository at this point in the history
  • Loading branch information
cooper-joe committed Mar 19, 2024
1 parent 0782f56 commit 87c3230
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ Feature: Clear text for the MultiSelectField

Scenario: Rendering a clearable MultiSelectField
Given a clearable MultiSelectField with selected option is rendered
When the clear button is hovered
Then the clear text is visible
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { Given, Then } from 'cypress-cucumber-preprocessor/steps'
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'

Given('a clearable MultiSelectField with selected option is rendered', () => {
cy.visitStory('MultiSelectField', 'With clearable and selected option')
})

When('the clear button is hovered', () => {
cy.get('[data-test="dhis2-uicore-multiselect-clear"]').trigger(
'mouseover',
'top'
)
})

Then('the clear text is visible', () => {
cy.contains('Clear').should('be.visible')
})
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ Feature: Clear text for the SingleSelectField

Scenario: Rendering a clearable SingleSelectField
Given a clearable SingleSelectField with selected option is rendered
When the clear button is hovered
Then the clear text is visible
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { Given, Then } from 'cypress-cucumber-preprocessor/steps'
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'

Given('a clearable SingleSelectField with selected option is rendered', () => {
cy.visitStory('SingleSelectField', 'With clearable and selected option')
})

When('the clear button is hovered', () => {
cy.get('[data-test="dhis2-uicore-singleselect-clear"]').trigger(
'mouseover',
'top'
)
})

Then('the clear text is visible', () => {
cy.contains('Clear').should('be.visible')
})

0 comments on commit 87c3230

Please sign in to comment.