-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
thisyahlen/chore: add test coverage for empty state (#8692)
* chore: add test coverage for empty state * chore: add test coverage for empty state * fix: remove stores
- Loading branch information
1 parent
1f5d6c2
commit de0a5ca
Showing
2 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
packages/appstore/src/components/empty-state/__tests__/empty-state.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React from 'react'; | ||
import EmptyState from '../empty-state'; | ||
import { render, screen } from '@testing-library/react'; | ||
|
||
describe('EmptyState', () => { | ||
it('should render correctly', () => { | ||
const { container } = render( | ||
<EmptyState | ||
icon_name='icon_name' | ||
renderMessage={() => ( | ||
<> | ||
<p>Message</p> | ||
<p>Some content</p> | ||
</> | ||
)} | ||
renderTitle={() => <p>Title</p>} | ||
/> | ||
); | ||
expect(container).toBeInTheDocument(); | ||
}); | ||
|
||
it('should render correctly with the correct text', () => { | ||
const { container } = render( | ||
<EmptyState | ||
icon_name='icon_name' | ||
renderMessage={() => ( | ||
<> | ||
<p>Message</p> | ||
<p>Some content</p> | ||
</> | ||
)} | ||
renderTitle={() => <p>Title</p>} | ||
/> | ||
); | ||
|
||
expect(container).toBeInTheDocument(); | ||
expect(screen.getByText('Message')).toBeInTheDocument(); | ||
expect(screen.getByText('Some content')).toBeInTheDocument(); | ||
expect(screen.getByText('Title')).toBeInTheDocument(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters