Ghost/apps/admin-x-settings/test/acceptance/search.test.ts
Jono M a8083960d8
Added test examples to AdminX demo (#19116)
refs https://github.com/TryGhost/Product/issues/4182

Updated framework to include shared test config for easier app setup.
2023-11-23 12:59:48 +00:00

24 lines
829 B
TypeScript

import {expect, test} from '@playwright/test';
import {globalDataRequests} from '../utils/acceptance';
import {mockApi} from '@tryghost/admin-x-framework/test/acceptance';
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();
});
});