mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 15:13:21 +00:00
test(e2e): add update and delete content type tests (#22325)
This commit is contained in:
parent
03640aa70e
commit
555a72384e
@ -166,4 +166,36 @@ test.describe('Edit collection type', () => {
|
||||
|
||||
await expect(page.getByRole('heading', { name: ctName })).toBeVisible();
|
||||
});
|
||||
|
||||
test('Can change type name', async ({ page }) => {
|
||||
const newname = 'New name';
|
||||
await page.getByRole('button', { name: 'Edit', exact: true }).click();
|
||||
|
||||
await page.getByRole('textbox', { name: 'Display name' }).fill(newname);
|
||||
|
||||
await page.getByRole('button', { name: 'Finish', exact: true }).click();
|
||||
|
||||
await waitForRestart(page);
|
||||
|
||||
// TODO: fix bug that requires a page refresh to see that content types have been updated
|
||||
await page.reload();
|
||||
|
||||
await expect(page.getByRole('heading', { name: newname })).toBeVisible();
|
||||
});
|
||||
|
||||
test('Can delete type', async ({ page }) => {
|
||||
await page.getByRole('button', { name: 'Edit', exact: true }).click();
|
||||
|
||||
// need to accept the browser modal
|
||||
page.on('dialog', (dialog) => dialog.accept());
|
||||
|
||||
await page.getByRole('button', { name: 'Delete', exact: true }).click();
|
||||
|
||||
await waitForRestart(page);
|
||||
|
||||
// TODO: fix bug that requires a page refresh to see that content types have been updated
|
||||
await page.reload();
|
||||
|
||||
await expect(page.getByRole('heading', { name: ctName })).not.toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
@ -91,4 +91,36 @@ test.describe('Edit single type', () => {
|
||||
|
||||
await expect(page.getByRole('heading', { name: ctName })).toBeVisible();
|
||||
});
|
||||
|
||||
test('Can change type name', async ({ page }) => {
|
||||
const newname = 'New name';
|
||||
await page.getByRole('button', { name: 'Edit', exact: true }).click();
|
||||
|
||||
await page.getByRole('textbox', { name: 'Display name' }).fill(newname);
|
||||
|
||||
await page.getByRole('button', { name: 'Finish', exact: true }).click();
|
||||
|
||||
await waitForRestart(page);
|
||||
|
||||
// TODO: fix bug that requires a page refresh to see that content types have been updated
|
||||
await page.reload();
|
||||
|
||||
await expect(page.getByRole('heading', { name: newname })).toBeVisible();
|
||||
});
|
||||
|
||||
test('Can delete type', async ({ page }) => {
|
||||
await page.getByRole('button', { name: 'Edit', exact: true }).click();
|
||||
|
||||
// need to accept the browser modal
|
||||
page.on('dialog', (dialog) => dialog.accept());
|
||||
|
||||
await page.getByRole('button', { name: 'Delete', exact: true }).click();
|
||||
|
||||
await waitForRestart(page);
|
||||
|
||||
// TODO: fix bug that requires a page refresh to see that content types have been updated
|
||||
await page.reload();
|
||||
|
||||
await expect(page.getByRole('heading', { name: ctName })).not.toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user