Skip to content

Commit e281dac

Browse files
committed
update test to use snapshot assertion
1 parent 8b48acb commit e281dac

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

tests/index.test.js.snapshot

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ exports[`e2e > calls a tool 1`] = `
55
exports[`e2e > calls a tool multiple times 1`] = `
66
[{"type":"text","text":"## Pages\\n1: about:blank [selected]"}]
77
`;
8+
9+
exports[`e2e > returns blocked message when dialog is opened during tool execution 1`] = `
10+
[{"type":"text","text":"[Blocked] Action triggered a dialog.\\n# Open dialog\\nalert: test dialog.\\nCall handle_dialog to handle it before continuing."}]
11+
`;

tests/index.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ describe('e2e', () => {
246246
);
247247
});
248248

249-
it('returns blocked message when dialog is opened during tool execution', async () => {
249+
it('returns blocked message when dialog is opened during tool execution', async t => {
250250
await withClient(async client => {
251251
// Navigate to a page with a button that triggers a dialog on click
252252
await client.callTool({
@@ -275,6 +275,7 @@ describe('e2e', () => {
275275

276276
const content = result.content as TextContent[];
277277
assert.match(content[0].text, /\[Blocked\] Action triggered a dialog\./);
278+
t.assert.snapshot?.(JSON.stringify(result.content));
278279
});
279280
});
280281
});

0 commit comments

Comments
 (0)