Skip to content

Commit

Permalink
chore(@clayui/empty-state): Add test for warning message and null val…
Browse files Browse the repository at this point in the history
…ue for imgSrcReducedMotion
  • Loading branch information
pat270 committed Jul 18, 2023
1 parent 1d6195d commit 7c16e99
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/clay-empty-state/src/__tests__/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ describe('ClayEmptyState', () => {
expect(container).toMatchSnapshot();
});

it('warns if reduced motion image does not exist on the server', () => {
const {container} = render(
<ClayEmptyState imgSrc="https://via.placeholder.com/256" />
);

jest.spyOn(global.console, 'warn')
});

it('renders with an image provided', () => {
const {container} = render(
<ClayEmptyState imgSrc="https://via.placeholder.com/256" />
Expand All @@ -24,6 +32,17 @@ describe('ClayEmptyState', () => {
expect(container).toMatchSnapshot();
});

it('does not render a reduced motion image if imgSrcReducedMotion={null}', () => {
const {container} = render(
<ClayEmptyState
imgSrc="https://via.placeholder.com/256"
imgSrcReducedMotion={null}
/>
);

expect(container).toMatchSnapshot();
});

it('renders with a reduced motion image provided', () => {
const {container} = render(
<ClayEmptyState
Expand Down

0 comments on commit 7c16e99

Please sign in to comment.