Skip to content

Commit

Permalink
Update e2e tests - add search and then remove search for displaying e…
Browse files Browse the repository at this point in the history
…xpected banners
  • Loading branch information
Xon committed Aug 31, 2024
1 parent 1801a04 commit 2d474d6
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
18 changes: 16 additions & 2 deletions test-e2e/tests/select-multiple.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ describe(`Choices - select multiple`, () => {
await suite.startWithClick();

await expect(suite.selectableChoices).toHaveCount(0);
await suite.expectVisibleNoticeHtml('No choices to choose from');
await suite.expectVisibleNoticeHtml('No choices to choose from', true);
});
});

Expand All @@ -393,7 +393,21 @@ describe(`Choices - select multiple`, () => {
await suite.startWithClick();

await expect(suite.selectableChoices).toHaveCount(0);
await suite.expectVisibleNoticeHtml('No choices to choose from');
await suite.expectVisibleNoticeHtml('No choices to choose from', true);
});

test('shows no results banner and then no choices banner', async ({ page, bundle }) => {
const invalidLabel = 'faergge';
const suite = new SelectTestSuit(page, bundle, testUrl, testId);
await suite.startWithClick();

await suite.typeText(invalidLabel);
await expect(suite.selectableChoices).toHaveCount(0);
await suite.expectVisibleNoticeHtml('No results found', true);

await suite.typeText('');
await expect(suite.selectableChoices).toHaveCount(0);
await suite.expectVisibleNoticeHtml('No choices to choose from', true);
});
});

Expand Down
18 changes: 16 additions & 2 deletions test-e2e/tests/select-one.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ describe(`Choices - select one`, () => {
await suite.startWithClick();

await expect(suite.selectableChoices).toHaveCount(0);
await suite.expectVisibleNoticeHtml('No choices to choose from');
await suite.expectVisibleNoticeHtml('No choices to choose from', true);
});
});

Expand All @@ -250,7 +250,21 @@ describe(`Choices - select one`, () => {
await suite.startWithClick();

await expect(suite.selectableChoices).toHaveCount(0);
await suite.expectVisibleNoticeHtml('No choices to choose from');
await suite.expectVisibleNoticeHtml('No choices to choose from', true);
});

test('shows no results banner and then no choices banner', async ({ page, bundle }) => {
const invalidLabel = 'faergge';
const suite = new SelectTestSuit(page, bundle, testUrl, testId);
await suite.startWithClick();

await suite.typeText(invalidLabel);
await expect(suite.selectableChoices).toHaveCount(0);
await suite.expectVisibleNoticeHtml('No results found', true);

await suite.typeText('');
await expect(suite.selectableChoices).toHaveCount(0);
await suite.expectVisibleNoticeHtml('No choices to choose from', true);
});
});

Expand Down

0 comments on commit 2d474d6

Please sign in to comment.