2023-06-28 05:59:05 +03:00
|
|
|
import {expect, test} from '@playwright/test';
|
|
|
|
import {mockApi} from '../utils/e2e';
|
|
|
|
|
|
|
|
test.describe('Search', async () => {
|
|
|
|
test('Hiding and showing groups based on the search term', async ({page}) => {
|
|
|
|
await mockApi({page});
|
|
|
|
|
|
|
|
await page.goto('/');
|
|
|
|
|
|
|
|
const searchBar = page.getByLabel('Search');
|
|
|
|
|
2023-07-06 13:03:01 +03:00
|
|
|
await searchBar.fill('design');
|
2023-06-28 05:59:05 +03:00
|
|
|
|
2023-07-06 13:03:01 +03:00
|
|
|
await expect(page.getByTestId('design')).toBeVisible();
|
2023-06-28 05:59:05 +03:00
|
|
|
await expect(page.getByTestId('title-and-description')).not.toBeVisible();
|
|
|
|
|
|
|
|
await searchBar.fill('title');
|
|
|
|
|
2023-07-06 13:03:01 +03:00
|
|
|
await expect(page.getByTestId('design')).not.toBeVisible();
|
2023-06-28 05:59:05 +03:00
|
|
|
await expect(page.getByTestId('title-and-description')).toBeVisible();
|
|
|
|
});
|
|
|
|
});
|