Skip to content

Commit

Permalink
Test to ensure the badge appears only once
Browse files Browse the repository at this point in the history
  • Loading branch information
tsullivan committed Sep 17, 2024
1 parent 959a142 commit 0b76046
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,16 @@ describe('SpacesGridPage', () => {
const nameCell = activeRow.find('[data-test-subj="spacesListTableRowNameCell"]');
const activeBadge = nameCell.find('EuiBadge');
expect(activeBadge.text()).toBe('current');

// ensure that current badge appears only once
const currentBadges = wrapper.findWhere((node) => {
return (
node.type() === 'span' &&
node.prop('data-test-subj') &&
node.prop('data-test-subj').includes('spacesListCurrentBadge')
);
});
expect(currentBadges.length).toBe(1);
});

it('renders a non-clickable "switch" action for the current space', async () => {
Expand Down

0 comments on commit 0b76046

Please sign in to comment.