Skip to content

Commit

Permalink
test(menu-item): test suffix prop
Browse files Browse the repository at this point in the history
  • Loading branch information
cooper-joe committed Nov 21, 2023
1 parent 907f746 commit 02bc9fe
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions components/menu/src/menu-item/features/accepts_suffix.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Feature: The MenuItem accepts a suffix prop

Scenario: MenuItem renders supplied suffix
Given a MenuItem supplied with a suffix is rendered
Then the suffix will be visible
10 changes: 10 additions & 0 deletions components/menu/src/menu-item/features/accepts_suffix/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Given, Then } from 'cypress-cucumber-preprocessor/steps'

Given('a MenuItem supplied with a suffix is rendered', () => {
cy.visitStory('MenuItem', 'With Suffix')
cy.get('[data-test="dhis2-uicore-menuitem"]').should('be.visible')
})

Then('the suffix will be visible', () => {
cy.contains('Suffix').should('be.visible')
})
2 changes: 2 additions & 0 deletions components/menu/src/menu-item/menu-item.stories.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ export const WithTarget = () => (
export const WithIcon = () => (
<MenuItem icon={<div>Icon</div>} label="Menu item" />
)

export const WithSuffix = () => <MenuItem suffix="Suffix" label="Menu item" />

0 comments on commit 02bc9fe

Please sign in to comment.