Skip to content

Commit

Permalink
Add noTooltip test for card information (#731)
Browse files Browse the repository at this point in the history
  • Loading branch information
GoelBiju committed Jul 13, 2021
1 parent 00a91fc commit 7fd0f9f
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions packages/datagateway-common/src/card/cardView.component.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,30 @@ describe('Card View', () => {
});
});

it('information displays with content that has no tooltip', () => {
const updatedProps = {
...props,
title: { dataKey: 'title', disableSort: true },
description: { dataKey: 'name', disableSort: true },
information: [
{
dataKey: 'name',
label: 'Name',
content: (entity: Entity) => 'Content',
noTooltip: true,
},
],
};

const wrapper = createWrapper(updatedProps);
expect(
wrapper.find('[aria-label="card-info-Name"]').first().text()
).toEqual('Name:');
expect(
wrapper.find('[aria-label="card-info-data-Name"]').first().text()
).toEqual('Content');
});

it('cannot sort when fields are disabled', () => {
const updatedProps = {
...props,
Expand Down

0 comments on commit 7fd0f9f

Please sign in to comment.