Skip to content

Commit a740b7e

Browse files
committed
test(shared): exercise scanner on large thread-link pastes
1 parent 981b850 commit a740b7e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎packages/shared/src/threadDeepLinks.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,13 @@ it.each([
8585
expect(normalizeThreadClipboard(text, null)).toEqual({ text, fragment: null });
8686
});
8787
it.each([
88-
"[".repeat(80000),
89-
'[{"a":1},'.repeat(125000),
9088
"[".repeat(80000) + " https://app.t3.codes/env/thread",
89+
'[{"a":1},'.repeat(125000) + " https://app.t3.codes/env/thread",
9190
])("handles large bracket-heavy pastes", (text) => {
9291
const result = normalizeThreadClipboard(text, null);
9392
expect(result.text.startsWith(text.slice(0, 80000))).toBe(true);
93+
expect(result.fragment?.records).toMatchObject([{ environmentId: "env", threadId: "thread" }]);
94+
expect(collectComposerContextReferences(result.text)).toHaveLength(1);
9495
});
9596
it.each(["/assets/index.js", "/.well-known/assetlinks.json", "/guest/x", "/new/x"])(
9697
"rejects reserved web paths: %s",

0 commit comments

Comments
 (0)