From 7c16e9923d725f85bc5c0c79c511f83a155c8757 Mon Sep 17 00:00:00 2001 From: Patrick Yeo Date: Tue, 18 Jul 2023 14:22:48 -0700 Subject: [PATCH] chore(@clayui/empty-state): Add test for warning message and null value for imgSrcReducedMotion --- .../clay-empty-state/src/__tests__/index.tsx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/clay-empty-state/src/__tests__/index.tsx b/packages/clay-empty-state/src/__tests__/index.tsx index e5a4ca0c7f..a9511bfe98 100644 --- a/packages/clay-empty-state/src/__tests__/index.tsx +++ b/packages/clay-empty-state/src/__tests__/index.tsx @@ -16,6 +16,14 @@ describe('ClayEmptyState', () => { expect(container).toMatchSnapshot(); }); + it('warns if reduced motion image does not exist on the server', () => { + const {container} = render( + + ); + + jest.spyOn(global.console, 'warn') + }); + it('renders with an image provided', () => { const {container} = render( @@ -24,6 +32,17 @@ describe('ClayEmptyState', () => { expect(container).toMatchSnapshot(); }); + it('does not render a reduced motion image if imgSrcReducedMotion={null}', () => { + const {container} = render( + + ); + + expect(container).toMatchSnapshot(); + }); + it('renders with a reduced motion image provided', () => { const {container} = render(