Skip to content

Commit

Permalink
Fix e2e tests (#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
LitoMore authored Dec 23, 2024
1 parent 4443034 commit 6cfa323
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions tests/e2e.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ describe('Search', () => {
});

it.each([
['by title', 'adobe', 'Adobe'],
['by title', 'dotenv ', '.ENV'],
['aka alias', 'All Elite Wrestling', 'AEW'],
['dup alias', 'GoToWebinar', 'GoToMeeting'],
['loc alias', 'КиноПоиск', 'Kinopoisk'],
Expand Down Expand Up @@ -174,31 +174,31 @@ describe('Search', () => {

it('shows the "order by relevance" button on search', async () => {
const $searchInput = await page.$('#search-input');
await $searchInput.type('adobe');
await $searchInput.type('dotenv');

const $orderRelevance = await page.$('#order-relevance');
expect(await isVisible($orderRelevance)).toBeTruthy();
});

it('shows the "clear search" button on search', async () => {
const $searchInput = await page.$('#search-input');
await $searchInput.type('adobe');
await $searchInput.type('env');

const $searchClear = await page.$('#search-clear');
expect(await isVisible($searchClear)).toBeTruthy();
});

it('enables ordering by relevance on search', async () => {
const $searchInput = await page.$('#search-input');
await $searchInput.type('adobe');
await $searchInput.type('env');

const $body = await page.$('body');
expect(await hasClass($body, 'order-relevance')).toBeTruthy();
});

it('resets the search when clicking the "clear search" button', async () => {
const $searchInput = await page.$('#search-input');
await $searchInput.type('adobe');
await $searchInput.type('env');

const $searchClear = await page.$('#search-clear');
await $searchClear.click();
Expand All @@ -214,7 +214,7 @@ describe('Search', () => {
await page.click(`#${id}`);

const $searchInput = await page.$('#search-input');
await $searchInput.type('adobe');
await $searchInput.type('env');

await $searchInput.click({clickCount: 3});
await $searchInput.press('Backspace');
Expand All @@ -231,7 +231,7 @@ describe('Search', () => {
await page.click(`#${id}`);

const $searchInput = await page.$('#search-input');
await $searchInput.type('adobe');
await $searchInput.type('env');

const $searchClear = await page.$('#search-clear');
await $searchClear.click();
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ if (process.env.TEST_ENV) {
}
};

for (const slug of ['adobe', 'aew', 'gotomeeting', 'kinopoisk'])
for (const slug of ['dotenv', 'aew', 'gotomeeting', 'kinopoisk'])
ensureIconDisplayed(slug);
}

Expand Down

0 comments on commit 6cfa323

Please sign in to comment.