Skip to content

Commit

Permalink
Fixes #1757 - Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bryceosterhaus committed Apr 5, 2019
1 parent 1b730ea commit 7d51e1d
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/clay-label/src/__tests__/ClayLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,20 @@ describe('ClayLabel', () => {

expect(testRenderer.toJSON()).toMatchSnapshot();
});

it('renders with a different displayType ', () => {
const testRenderer = TestRenderer.create(
<ClayLabel displayType="success">{'Success Label'}</ClayLabel>
);

expect(testRenderer.toJSON()).toMatchSnapshot();
});

it('renders as a link ', () => {
const testRenderer = TestRenderer.create(
<ClayLabel href="#/foo/bar">{'Label w/ link'}</ClayLabel>
);

expect(testRenderer.toJSON()).toMatchSnapshot();
});
});
25 changes: 25 additions & 0 deletions packages/clay-label/src/__tests__/__snapshots__/ClayLabel.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,28 @@ exports[`ClayLabel renders 1`] = `
</span>
</span>
`;

exports[`ClayLabel renders as a link 1`] = `
<a
className="label label-secondary"
href="#/foo/bar"
>
<span
className="label-item label-item-expand"
>
Label w/ link
</span>
</a>
`;

exports[`ClayLabel renders with a different displayType 1`] = `
<span
className="label label-success"
>
<span
className="label-item label-item-expand"
>
Success Label
</span>
</span>
`;

0 comments on commit 7d51e1d

Please sign in to comment.