2023-10-06 12:06:05 +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-10-06 12:06:05 +03:00
|
|
|
|
|
|
|
test.describe('Layout', async () => {
|
|
|
|
test('Confirms when leaving if a section is dirty', async ({page}) => {
|
|
|
|
await mockApi({page, requests: globalDataRequests});
|
|
|
|
|
|
|
|
await page.goto('/');
|
|
|
|
|
|
|
|
const section = page.getByTestId('title-and-description');
|
|
|
|
|
|
|
|
await section.getByRole('button', {name: 'Edit'}).click();
|
|
|
|
|
|
|
|
await section.getByLabel('Site title').fill('New Site Title');
|
|
|
|
|
|
|
|
await page.getByTestId('exit-settings').click();
|
|
|
|
|
|
|
|
await expect(page.getByTestId('confirmation-modal')).toHaveText(/leave/i);
|
|
|
|
});
|
|
|
|
});
|