2023-06-27 21:59:05 -05:00
|
|
|
import {expect, test} from '@playwright/test';
|
2023-11-23 07:59:48 -05:00
|
|
|
import {globalDataRequests} from '../utils/acceptance';
|
|
|
|
import {mockApi} from '@tryghost/admin-x-framework/test/acceptance';
|
2023-06-27 21:59:05 -05:00
|
|
|
|
|
|
|
test.describe('Search', async () => {
|
|
|
|
test('Hiding and showing groups based on the search term', async ({page}) => {
|
2023-08-03 03:29:14 -05:00
|
|
|
await mockApi({page, requests: globalDataRequests});
|
2023-06-27 21:59:05 -05:00
|
|
|
|
|
|
|
await page.goto('/');
|
|
|
|
|
|
|
|
const searchBar = page.getByLabel('Search');
|
|
|
|
|
2023-07-06 05:03:01 -05:00
|
|
|
await searchBar.fill('design');
|
2023-06-27 21:59:05 -05:00
|
|
|
|
2023-07-06 05:03:01 -05:00
|
|
|
await expect(page.getByTestId('design')).toBeVisible();
|
2023-06-27 21:59:05 -05:00
|
|
|
await expect(page.getByTestId('title-and-description')).not.toBeVisible();
|
|
|
|
|
|
|
|
await searchBar.fill('title');
|
|
|
|
|
2023-07-06 05:03:01 -05:00
|
|
|
await expect(page.getByTestId('design')).not.toBeVisible();
|
2023-06-27 21:59:05 -05:00
|
|
|
await expect(page.getByTestId('title-and-description')).toBeVisible();
|
|
|
|
});
|
|
|
|
});
|