Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

test(browser): 覆盖脚本标签的大小写转义

Dash5985a006df9e
diff --git a/packages/lizi-mcps/src/browser/extract.test.ts b/packages/lizi-mcps/src/browser/extract.test.ts
index e95fa2d017..b9d680194e 100644
--- a/packages/lizi-mcps/src/browser/extract.test.ts
+++ b/packages/lizi-mcps/src/browser/extract.test.ts
@@ -30,9 +30,9 @@ describe('buildExtractFnSource', () => {
// separators in executable source. Exercise the generated function as well
// as its code/data boundary; selector and attribute values must round-trip.
it('escapes script delimiters and line separators without altering DOM read data', () => {
- const payload = '</script><script>throw new Error("injected")</script>\u2028\u2029';
+ const payload = '</script><SCRIPT>throw new Error("injected")</SCRIPT>\u2028\u2029';
const src = buildExtractFnSource({ fields: { value: { selector: payload, attr: payload } } });
- expect(src).not.toMatch(/<\/?script>|[\u2028\u2029]/u);
+ expect(src).not.toMatch(/<\/?script>|[\u2028\u2029]/iu);
const received: string[] = [];
const g = globalThis as unknown as { document?: unknown };
const previous = g.document;