Skip to content

Commit

Permalink
added test for custom size
Browse files Browse the repository at this point in the history
  • Loading branch information
anishagg17 committed Mar 18, 2020
1 parent d54ab10 commit 5dd124a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/components/image/__snapshots__/image.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,18 @@ exports[`EuiImage is rendered and allows full screen 1`] = `
</button>
</figure>
`;

exports[`EuiImage is rendered with custom size 1`] = `
<figure
class="euiImage testClass1 testClass2"
>
<img
alt="alt"
aria-label="aria-label"
class="euiImage__img"
data-test-subj="test subject string"
src="/cat.jpg"
style="max-width:50px;max-height:50px;min-width:0;min-height:0;width:auto;height:auto"
/>
</figure>
`;
8 changes: 8 additions & 0 deletions src/components/image/image.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,12 @@ describe('EuiImage', () => {

expect(component).toMatchSnapshot();
});

test('is rendered with custom size', () => {
const component = render(
<EuiImage alt="alt" size={50} url="/cat.jpg" {...requiredProps} />
);

expect(component).toMatchSnapshot();
});
});

0 comments on commit 5dd124a

Please sign in to comment.