mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-19 11:06:25 +08:00
chore: improve test stability
This commit is contained in:
@@ -18,11 +18,13 @@ export async function expectActiveTab(
|
||||
export async function expectTabTitle(
|
||||
page: Page,
|
||||
index: number,
|
||||
title: string | string[]
|
||||
title: string | string[],
|
||||
timeout?: number
|
||||
) {
|
||||
if (typeof title === 'string') {
|
||||
await expect(page.getByTestId('workbench-tab').nth(index)).toContainText(
|
||||
title
|
||||
title,
|
||||
{ timeout }
|
||||
);
|
||||
} else {
|
||||
for (let i = 0; i < title.length; i++) {
|
||||
@@ -32,7 +34,7 @@ export async function expectTabTitle(
|
||||
.nth(index)
|
||||
.getByTestId('split-view-label')
|
||||
.nth(i)
|
||||
).toContainText(title[i]);
|
||||
).toContainText(title[i], { timeout });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user