2023-06-28 05:59:05 +03:00
|
|
|
import {expect, test} from '@playwright/test';
|
2023-10-03 12:20:40 +03:00
|
|
|
import {globalDataRequests, mockApi} from '../utils/acceptance';
|
2023-06-28 05:59:05 +03:00
|
|
|
|
|
|
|
test.describe('Search', async () => {
|
|
|
|
test('Hiding and showing groups based on the search term', async ({page}) => {
|
2023-08-03 11:29:14 +03:00
|
|
|
await mockApi({page, requests: globalDataRequests});
|
2023-06-28 05:59:05 +03:00
|
|
|
|
|
|
|
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();
|
|
|
|
});
|
|
|
|
});
|