Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
Update jest tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Tran authored and Andrew Tran committed Oct 6, 2023
1 parent c861937 commit f3c45fc
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
10 changes: 9 additions & 1 deletion packages/terra-clinical-item-view/tests/jest/ItemView.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,21 @@ it('should render a default component', () => {
expect(itemView).toMatchSnapshot();
});

it('should render with null display', () => {
it('should render with null displays prop', () => {
const itemView = shallow(<ItemView displays={null} />);

expect(itemView.find('ItemDisplay')).toHaveLength(0);
expect(itemView.find('.body').props().children).toEqual([undefined, undefined]);
expect(itemView).toMatchSnapshot();
});

it('should render with null display item', () => {
const itemView = shallow(<ItemView displays={[null]} />);

expect(itemView.find('ItemDisplay')).toHaveLength(0);
expect(itemView).toMatchSnapshot();
});

it('should render with 1 display', () => {
const display1 = shallowWithIntl(<ItemView.Display text="display 1" />);
const displays = [display1];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2421,7 +2421,25 @@ exports[`should render with a display and graphic 1`] = `
</div>
`;

exports[`should render with null display 1`] = `
exports[`should render with null display item 1`] = `
<div
className="item-view one-column"
>
<div
className="body"
>
<div
className="single-result-column-container"
>
<div
className="content content-primary-size content-primary-color"
/>
</div>
</div>
</div>
`;

exports[`should render with null displays prop 1`] = `
<div
className="item-view one-column"
>
Expand Down

0 comments on commit f3c45fc

Please sign in to comment.