2023-11-22 10:51:10 +03:00
|
|
|
import {expect, test} from '@playwright/test';
|
2023-11-23 15:59:48 +03:00
|
|
|
import {globalDataRequests} from '../utils/acceptance';
|
|
|
|
import {mockApi} from '@tryghost/admin-x-framework/test/acceptance';
|
2023-11-22 10:51:10 +03:00
|
|
|
|
|
|
|
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$/);
|
|
|
|
});
|
|
|
|
});
|