Skip to content

Commit

Permalink
Add customMessage example
Browse files Browse the repository at this point in the history
  • Loading branch information
arkadiuszbachorski committed Oct 15, 2024
1 parent 2032ed0 commit 0b158f3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ export const MiscFilters: Story = {
export const TextFilter: Story = {
args: { textFilter: 'John Doe' },
}

Check warning on line 31 in packages/design-system/src/components/EmptyState/EmptyState.stories.tsx

View check run for this annotation

Codecov / codecov/patch

packages/design-system/src/components/EmptyState/EmptyState.stories.tsx#L29-L31

Added lines #L29 - L31 were not covered by tests

export const CustomMessage: Story = {
args: { children: 'Data is missing' },
}

Check warning on line 35 in packages/design-system/src/components/EmptyState/EmptyState.stories.tsx

View check run for this annotation

Codecov / codecov/patch

packages/design-system/src/components/EmptyState/EmptyState.stories.tsx#L33-L35

Added lines #L33 - L35 were not covered by tests
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,12 @@ describe('EmptyState', () => {

expect(element).toBeInTheDocument()
})

it('supports completely custom message', () => {
render(<EmptyState>Data is missing</EmptyState>)

const element = screen.getByText('Data is missing')

expect(element).toBeInTheDocument()
})
})

0 comments on commit 0b158f3

Please sign in to comment.