Ghost/apps/admin-x-settings/test/acceptance/advanced/dangerzone.test.ts
Peter Zimon 58d9b8e382
Update migration in settings (#19278)
refs.
7b40393d77

We're improving the usability and possibilities for publishers to
migrate from other platforms such as Substack, Medium or Mailchimp. This
PR applies changes to Ghost Settings to support the new flows, more
specifically:

- moves import and export functions out of Labs to its own setting,
directly available from search and the menu
- adds direct access to various platform migrations
- moves "Delete all content" to a dedicated setting group at the bottom
of all setting

---------

Co-authored-by: Jono Mingard <reason.koan@gmail.com>
2023-12-13 16:25:29 +01:00

25 lines
921 B
TypeScript

import {expect, test} from '@playwright/test';
import {globalDataRequests} from '../../utils/acceptance';
import {mockApi} from '@tryghost/admin-x-framework/test/acceptance';
test.describe('DangerZone', async () => {
test('Delete all content', async ({page}) => {
const {lastApiRequests} = await mockApi({page, requests: {
...globalDataRequests,
deleteAllContent: {method: 'DELETE', path: '/db/', response: {}}
}});
await page.goto('/');
const dangeZoneSection = page.getByTestId('dangerzone');
await dangeZoneSection.getByRole('button', {name: 'Delete all content'}).click();
await page.getByTestId('confirmation-modal').getByRole('button', {name: 'Delete'}).click();
await expect(page.getByTestId('toast-success')).toContainText('All content deleted');
expect(lastApiRequests.deleteAllContent).toBeTruthy();
});
});