feat: delete a custom type
This commit is contained in:
1 parent
76e9e1220c
commit
5404291af2
25 files changed
+1768
-46
No files matched your search
+8
-1
@@ -74,7 +74,14 @@ const extraSources: Record<string, Source[]> = {
|
||||
{
|
||||
board: schemaBoard,
|
||||
group: '3 Review and delete',
|
||||
states: ['Review before saving', 'Applying', 'Refused (schema_incompatible)'],
|
||||
states: [
|
||||
'Review before saving',
|
||||
'Applying',
|
||||
'Refused (schema_incompatible)',
|
||||
'Delete type: blocked',
|
||||
'Delete type: confirm',
|
||||
'Delete type: server fallback (409)',
|
||||
],
|
||||
alias: {},
|
||||
},
|
||||
],
|
||||
|
||||
+68
-1
@@ -6651,6 +6651,12 @@ async function schemaFieldErrors(page: Page) {
|
||||
await schemaSettle(page)
|
||||
}
|
||||
|
||||
async function schemaChooseDelete(page: Page) {
|
||||
await page.getByRole('button', { name: 'More actions' }).click()
|
||||
await page.getByRole('menuitem', { name: 'Delete content type' }).click()
|
||||
await page.getByRole('alertdialog').waitFor()
|
||||
}
|
||||
|
||||
async function schemaCategoryChoices(page: Page) {
|
||||
await schemaOpenRow(page, 'Category')
|
||||
await page.locator('[data-testid="choice-row"] input').nth(2).fill('')
|
||||
@@ -6739,7 +6745,22 @@ const schemaStates: Record<string, VisualState> = {
|
||||
await page.mouse.move(0, 0)
|
||||
},
|
||||
},
|
||||
'Field key error': { path: '/schema/new', skip: 'pending' },
|
||||
'Field key error': {
|
||||
path: '/schema/events',
|
||||
api: schemaApi(),
|
||||
steps: async (page) => {
|
||||
await schemaAddField(page, 'Second date')
|
||||
await page.locator('label:has([role="radio"][value="date"])').click()
|
||||
await page
|
||||
.locator('[data-testid="field-inspector"]')
|
||||
.getByRole('button', { name: 'Edit key' })
|
||||
.click()
|
||||
await page.locator('input[name="field-key"]').fill('2nd-date')
|
||||
await page.getByText('1 problem to fix').first().waitFor()
|
||||
await schemaCloseSheet(page)
|
||||
await schemaSettle(page)
|
||||
},
|
||||
},
|
||||
'Choice list editor': {
|
||||
exception: {
|
||||
maxPercent: { desktop: 10, mobile: 25 },
|
||||
@@ -6872,6 +6893,52 @@ const schemaStates: Record<string, VisualState> = {
|
||||
await schemaSettle(page)
|
||||
},
|
||||
},
|
||||
'Delete type: blocked': {
|
||||
exception: {
|
||||
maxPercent: { desktop: 15, mobile: 10 },
|
||||
reason: 'the design board draws a miniature of the board and a mobile-sized dialog overlay inside the desktop frame',
|
||||
approvedBy: 'user',
|
||||
},
|
||||
path: '/schema/events',
|
||||
api: schemaApi(),
|
||||
steps: async (page) => {
|
||||
await schemaChooseDelete(page)
|
||||
await schemaSettle(page)
|
||||
},
|
||||
},
|
||||
'Delete type: confirm': {
|
||||
exception: {
|
||||
maxPercent: { desktop: 48, mobile: 10 },
|
||||
reason: 'the design board draws a miniature of the board and a mobile-sized dialog overlay inside the desktop frame',
|
||||
approvedBy: 'user',
|
||||
},
|
||||
path: '/schema/recipes',
|
||||
api: schemaApi(),
|
||||
steps: async (page) => {
|
||||
await schemaChooseDelete(page)
|
||||
await schemaSettle(page)
|
||||
},
|
||||
},
|
||||
'Delete type: server fallback (409)': {
|
||||
exception: {
|
||||
maxPercent: { desktop: 35, mobile: 10 },
|
||||
reason: 'the design board draws a miniature of the board and a mobile-sized dialog overlay inside the desktop frame',
|
||||
approvedBy: 'user',
|
||||
},
|
||||
path: '/schema/recipes',
|
||||
api: schemaApi({
|
||||
'DELETE /v1/content-type/recipes': { status: 409, body: 'content_type_has_entries' },
|
||||
}),
|
||||
steps: async (page) => {
|
||||
await schemaChooseDelete(page)
|
||||
await page
|
||||
.getByRole('alertdialog')
|
||||
.getByRole('button', { name: 'Delete content type' })
|
||||
.click()
|
||||
await page.getByText('Recipes now has entries').waitFor()
|
||||
await schemaSettle(page)
|
||||
},
|
||||
},
|
||||
Offline: {
|
||||
path: '/schema/events',
|
||||
api: schemaApi(),
|
||||
|
||||
Reference in new issue
Block a user