Ghost/apps/admin-x-settings/test/e2e/search.test.ts
Jono M c46761199b
Cleaned up AdminX API handling (#17571)
refs https://github.com/TryGhost/Product/issues/3349

- Simplified a few more places after switching to react-query
- Improved how mocking works in specs to be more scalable as the number
of queries increases
2023-08-03 09:29:14 +01:00

23 lines
762 B
TypeScript

import {expect, test} from '@playwright/test';
import {globalDataRequests, mockApi} from '../utils/e2e';
test.describe('Search', async () => {
test('Hiding and showing groups based on the search term', async ({page}) => {
await mockApi({page, requests: globalDataRequests});
await page.goto('/');
const searchBar = page.getByLabel('Search');
await searchBar.fill('design');
await expect(page.getByTestId('design')).toBeVisible();
await expect(page.getByTestId('title-and-description')).not.toBeVisible();
await searchBar.fill('title');
await expect(page.getByTestId('design')).not.toBeVisible();
await expect(page.getByTestId('title-and-description')).toBeVisible();
});
});