mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
fix(core): stuck when quick switch doc mode (#7599)
This commit is contained in:
@@ -19,3 +19,37 @@ export async function clickPageModeButton(page: Page) {
|
||||
page.locator('[data-testid="switch-page-mode-button"][data-active="true"]')
|
||||
).toBeVisible();
|
||||
}
|
||||
|
||||
export async function ensureInPageMode(page: Page) {
|
||||
await expect(
|
||||
page.locator('[data-testid="switch-page-mode-button"][data-active="true"]')
|
||||
).toBeVisible();
|
||||
}
|
||||
|
||||
export async function ensureInEdgelessMode(page: Page) {
|
||||
await expect(
|
||||
page.locator(
|
||||
'[data-testid="switch-edgeless-mode-button"][data-active="true"]'
|
||||
)
|
||||
).toBeVisible();
|
||||
}
|
||||
|
||||
export async function getPageMode(page: Page): Promise<'page' | 'edgeless'> {
|
||||
if (
|
||||
await page
|
||||
.locator('[data-testid="switch-page-mode-button"][data-active="true"]')
|
||||
.isVisible()
|
||||
) {
|
||||
return 'page';
|
||||
}
|
||||
if (
|
||||
await page
|
||||
.locator(
|
||||
'[data-testid="switch-edgeless-mode-button"][data-active="true"]'
|
||||
)
|
||||
.isVisible()
|
||||
) {
|
||||
return 'edgeless';
|
||||
}
|
||||
throw new Error('Unknown mode');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user