test(tests): working-copy dialog checks independent of the shared slot
admin.spec opened the working-copy dialog on the historical sheet, whose single slot was taken by a copy the sandbox suite leaked. The dialog checks move to an e2e:ui page on the real component; the suite archives its own copies.
This commit is contained in:
1 parent
da298cfab1
commit
2cdee42fe1
9 files changed
+304
-25
No files matched your search
@@ -750,20 +750,24 @@ for (const [locale, dict] of LANGUAGES) {
|
||||
await expectAccessible(page, `${path} at ${width} px`)
|
||||
await expectNoHorizontalOverflow(page, `${path} at ${width} px`)
|
||||
}
|
||||
// The working copy dialog on the historical sheet (W1 start), opened only.
|
||||
await page
|
||||
.getByRole('button', { name: dict['admin.working_copy.create'] })
|
||||
.first()
|
||||
.click()
|
||||
const copy = page.getByRole('dialog', {
|
||||
// The historical page is left on the page loop's last entry. Its working
|
||||
// copy button follows the single slot, shared database state: disabled
|
||||
// exactly when the reason is shown and linked to it. The dialog itself is
|
||||
// checked on the real component in e2e/ui/working-copy.spec.ts.
|
||||
const action = main(page).getByRole('button', {
|
||||
name: dict['admin.working_copy.create'],
|
||||
})
|
||||
await expect(copy).toBeVisible()
|
||||
await expectAccessible(page, `the working copy dialog at ${width} px`)
|
||||
await expectNoHorizontalOverflow(
|
||||
page,
|
||||
`the working copy dialog at ${width} px`,
|
||||
)
|
||||
await expect(action).toBeVisible()
|
||||
const reason = main(page).getByText(dict['admin.working_copy.active'])
|
||||
if ((await reason.count()) > 0) {
|
||||
await expect(action).toBeDisabled()
|
||||
await expect(action).toHaveAccessibleDescription(
|
||||
dict['admin.working_copy.active'],
|
||||
)
|
||||
} else {
|
||||
await expect(action).toBeEnabled()
|
||||
await expect(action).not.toHaveAttribute('aria-describedby')
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user