Skip to content

Commit 179e88e

Browse files
authored
fix(web-intergration): add return for async type method (#1016)
1 parent 7aa893d commit 179e88e

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

packages/core/tests/ai/extract/extract.test.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,14 @@ describe('extract', () => {
2727
dataQuery: '{name: string, price: string}[], 饮品名称和价格',
2828
context,
2929
});
30-
expect(parseResult).toMatchSnapshot();
30+
31+
// Remove the thought field since it's generated dynamically by AI
32+
// but keep data and errors fields
33+
const snapshotResult = {
34+
data: parseResult.data,
35+
errors: parseResult.errors || [],
36+
};
37+
expect(snapshotResult).toMatchSnapshot();
3138
});
3239

3340
it('todo obj', async () => {
@@ -38,6 +45,13 @@ describe('extract', () => {
3845
'{checked: boolean; text: string;}[], Task list with checkbox ahead of the task name (checkbox is a round box), task name as string and `checked` is true if the task is completed. Exclude the fist row if there is no round checkbox ahead of the task name.',
3946
context,
4047
});
41-
expect(parseResult).toMatchSnapshot();
48+
49+
// Remove the thought field since it's generated dynamically by AI
50+
// but keep data and errors fields
51+
const snapshotResult = {
52+
data: parseResult.data,
53+
errors: parseResult.errors || [],
54+
};
55+
expect(snapshotResult).toMatchSnapshot();
4256
});
4357
});

packages/web-integration/src/puppeteer/base-page.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ export class Page<
254254
return {
255255
type: async (text: string) => {
256256
debugPage(`keyboard type ${text}`);
257-
this.underlyingPage.keyboard.type(text, { delay: 80 });
257+
return this.underlyingPage.keyboard.type(text, { delay: 80 });
258258
},
259259
press: async (
260260
action:

0 commit comments

Comments
 (0)