mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 13:25:12 +00:00
test(core): add missing await for expect (#11900)
This commit is contained in:
@@ -70,7 +70,7 @@ test.describe('AIChatWith/Network', () => {
|
||||
20000
|
||||
);
|
||||
const { message } = await utils.chatPanel.getLatestAssistantMessage(page);
|
||||
expect(await message.locator('affine-footnote-node').count()).toBe(0);
|
||||
await expect(message.locator('affine-footnote-node')).toHaveCount(0);
|
||||
});
|
||||
|
||||
test('should disable network search when chating with image', async ({
|
||||
|
||||
@@ -37,7 +37,7 @@ test.describe('AIChatWith/tags', () => {
|
||||
const { content, message } =
|
||||
await utils.chatPanel.getLatestAssistantMessage(page);
|
||||
expect(content).toMatch(/TagAAaa.*cat/);
|
||||
expect(await message.locator('affine-footnote-node').count()).toBe(1);
|
||||
await expect(message.locator('affine-footnote-node')).toHaveCount(1);
|
||||
}).toPass();
|
||||
});
|
||||
|
||||
@@ -67,7 +67,7 @@ test.describe('AIChatWith/tags', () => {
|
||||
await utils.chatPanel.getLatestAssistantMessage(page);
|
||||
expect(content).toMatch(/TagEEee.*cat/);
|
||||
expect(content).toMatch(/TagFFff.*dog/);
|
||||
expect(await message.locator('affine-footnote-node').count()).toBe(2);
|
||||
await expect(message.locator('affine-footnote-node')).toHaveCount(2);
|
||||
}).toPass();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -31,7 +31,7 @@ test.describe('AIInsertion/SaveAsDoc', () => {
|
||||
const { actions, content } =
|
||||
await utils.chatPanel.getLatestAssistantMessage(page);
|
||||
await actions.saveAsDoc();
|
||||
await page.getByText('New doc created');
|
||||
await page.getByText('New doc created').waitFor({ state: 'visible' });
|
||||
|
||||
// Verify the ai block is created
|
||||
const editorContent = await utils.editor.getEditorContent(page);
|
||||
@@ -63,7 +63,7 @@ test.describe('AIInsertion/SaveAsDoc', () => {
|
||||
const { actions, content } =
|
||||
await utils.chatPanel.getLatestAssistantMessage(page);
|
||||
await actions.saveAsDoc();
|
||||
await page.getByText('New doc created');
|
||||
await page.getByText('New doc created').waitFor({ state: 'visible' });
|
||||
|
||||
// Switch to page mode
|
||||
await utils.editor.isPageMode(page);
|
||||
|
||||
Reference in New Issue
Block a user