Ghost/apps/admin-x-settings/test/acceptance/routing.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

25 lines
803 B
TypeScript

import {expect, test} from '@playwright/test';
import {globalDataRequests} from '../utils/acceptance';
import {mockApi} from '@tryghost/admin-x-framework/test/acceptance';
test.describe('Routing', async () => {
test('Reopens the opened modal when refreshing the page', async ({page}) => {
await mockApi({page, requests: globalDataRequests});
await page.goto('/');
const section = page.getByTestId('portal');
await section.getByRole('button', {name: 'Customize'}).click();
await page.waitForSelector('[data-testid="portal-modal"]');
expect(page.url()).toMatch(/\/portal\/edit$/);
await page.reload();
await page.waitForSelector('[data-testid="portal-modal"]');
expect(page.url()).toMatch(/\/portal\/edit$/);
});
});