Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

composerContextLegacy.test.ts

638 lines22.1 KB

1import { describe, expect, it } from "vite-plus/test";
2​
3import { upgradeLegacyContextMessage } from "./composerContextLegacy.ts";
4​
5describe("upgradeLegacyContextMessage", () => {
6 const review =
7 '<review_comment sectionId="s" filePath="f.ts" startIndex="1" endIndex="1">note</review_comment>';
8​
9 it.each([
10 {
11 tag: "terminal_context",
12 body: `- Build line 1:\n ${review}`,
13 payload: { kind: "terminal", text: review },
14 },
15 {
16 tag: "element_context",
17 body: `- <div>:\n html:\n ${review}`,
18 payload: { kind: "element", htmlPreview: review },
19 },
20 {
21 tag: "preview_annotation",
22 body: `Page: Example\nComment: ${review}`,
23 payload: { kind: "preview-annotation", comment: review },
24 },
25 {
26 tag: "preview_annotation",
27 body: `Page: Example\n<element_context>\n- <div>:\n html:\n ${review}\n</element_context>`,
28 payload: {
29 kind: "preview-annotation",
30 elements: [expect.objectContaining({ htmlPreview: review })],
31 },
32 },
33 ])("preserves review-shaped payloads in $tag", ({ tag, body, payload }) => {
34 for (const suffix of ["", `\n${review}`]) {
35 const result = upgradeLegacyContextMessage(
36 `Before ${review} after\n<${tag}>\n${body}\n</${tag}>${suffix}`,
37 );
38 expect(result.records[0]).toMatchObject(payload);
39 expect(result.records.filter((record) => record.kind === "review-comment")).toHaveLength(
40 suffix ? 2 : 1,
41 );
42 expect(result.text).not.toContain("\uE000");
43 expect(result.text).toContain(
44 "Before [f.ts line](t3-context://v1/review-comment/legacy_review-comment_1) after",
45 );
46 }
47 });
48​
49 it.each(["terminal_context", "element_context"])(
50 "keeps mixed messages atomic for malformed %s",
51 (tag) => {
52 const text = `Before ${review} after\n<${tag}>\ninvalid entry\n</${tag}>`;
53 expect(upgradeLegacyContextMessage(text)).toEqual({ text, records: [] });
54 },
55 );
56​
57 it.each([
58 "unparsed content",
59 "- Invalid header:\n html: text",
60 "- <div>:\n html:\n <div />\nunparsed content",
61 ])("preserves malformed nested preview elements: %s", (body) => {
62 const text = `Before ${review} after\n<preview_annotation>\nPage: Example\n<element_context>\n${body}\n</element_context>\n</preview_annotation>`;
63 expect(upgradeLegacyContextMessage(text)).toEqual({ text, records: [] });
64 });
65​
66 it("allows an empty nested element block", () => {
67 const result = upgradeLegacyContextMessage(
68 "<preview_annotation>\nPage: Example\n<element_context>\n\n</element_context>\n</preview_annotation>",
69 );
70 expect(result.records).toHaveLength(1);
71 expect(result.records[0]).toMatchObject({ kind: "preview-annotation", pageTitle: "Example" });
72 });
73​
74 it.each([3, 4, 6])("preserves closing review tags inside a %i-backtick fence", (length) => {
75 const fence = "`".repeat(length);
76 const diff = '+ const tag = "</review_comment>";\n</review_comment>\n+ final line';
77 const block = `<review_comment sectionId="s" filePath="f.ts" startIndex="1" endIndex="1">\nComment\n${fence}diff\n${diff}\n${fence}\n</review_comment>`;
78 const result = upgradeLegacyContextMessage(`Before ${block} between ${review} after`);
79 expect(result.text).toBe(
80 "Before [f.ts line](t3-context://v1/review-comment/legacy_review-comment_1) between [f.ts line](t3-context://v1/review-comment/legacy_review-comment_2) after",
81 );
82 expect(result.records).toHaveLength(2);
83 expect(result.records[0]).toMatchObject({ text: "Comment", diff, fenceLanguage: "diff" });
84 });
85​
86 it("does not close a review fence at a shorter backtick run", () => {
87 const diff = "```\n</review_comment>\n+ remaining source";
88 const text = `<review_comment sectionId="s" filePath="f.ts" startIndex="1" endIndex="1">\nNote\n\`\`\`\`diff\n${diff}\n\`\`\`\`\n</review_comment>`;
89 expect(upgradeLegacyContextMessage(text).records[0]).toMatchObject({ text: "Note", diff });
90 });
91​
92 it("preserves a review with an unterminated fence", () => {
93 const text =
94 '<review_comment sectionId="s" filePath="f.ts" startIndex="1" endIndex="1">\nNote\n```diff\n+ source\n</review_comment>';
95 expect(upgradeLegacyContextMessage(text)).toEqual({ text, records: [] });
96 });
97​
98 it.each([
99 `- ${"x".repeat(256)} line 1:\n output`,
100 `- Build line 1:\n ${"x".repeat(64_001)}`,
101 "- Build lines 9-1:\n output",
102 Array.from({ length: 201 }, () => "- Build line 1:\n output").join("\n"),
103 ])("keeps terminal source when conversion exceeds the wire contract", (body) => {
104 const text = `Prompt\n<terminal_context>\n${body}\n</terminal_context>`;
105 expect(upgradeLegacyContextMessage(text)).toEqual({ text, records: [] });
106 });
107​
108 it.each([
109 `<element_context>\n- <div>:\n html:\n ${"x".repeat(8_001)}\n</element_context>`,
110 `<preview_annotation>\nComment: ${"x".repeat(8_001)}\n</preview_annotation>`,
111 ])("keeps oversized element and preview source", (text) => {
112 expect(upgradeLegacyContextMessage(text)).toEqual({ text, records: [] });
113 });
114​
115 it.each([
116 "email@build:7",
117 "café@build:7",
118 "𐐀@build:7",
119 "@build:7foo",
120 "@build:7st",
121 "@build:7é",
122 "@build:7.foo",
123 "@build:7@mention",
124 "@build:7..foo",
125 "@build:7.é",
126 ])("does not replace terminal labels embedded in %s", (prompt) => {
127 const upgraded = upgradeLegacyContextMessage(
128 `${prompt}\n<terminal_context>\n- Build line 7:\n output\n</terminal_context>`,
129 );
130 expect(upgraded.text).toBe(
131 `${prompt}\n\n[Build line 7](t3-context://v1/terminal/legacy_terminal_1)`,
132 );
133 });
134​
135 it.each([".", ",", ":", ";", "!", "?", ")", "@", ". Next sentence", "@ next", ".)"])(
136 "upgrades terminal labels before punctuation %s",
137 (suffix) => {
138 const result = upgradeLegacyContextMessage(
139 `See @build:7${suffix}\n<terminal_context>\n- Build line 7:\n output\n</terminal_context>`,
140 );
141 expect(result.text).toBe(
142 `See [Build line 7](t3-context://v1/terminal/legacy_terminal_1)${suffix}`,
143 );
144 expect(result.records).toHaveLength(1);
145 },
146 );
147​
148 it.each(["terminal_context", "element_context"])(
149 "preserves malformed trailing %s blocks as text",
150 (tag) => {
151 for (const body of ["partial output", "- Unrecognized header:\n partial output"]) {
152 const text = `message\n<${tag}>\n${body}\n</${tag}>`;
153 expect(upgradeLegacyContextMessage(text)).toEqual({ text, records: [] });
154 }
155 },
156 );
157​
158 it.each(["terminal_context", "element_context"])(
159 "preserves partially parsed %s blocks",
160 (tag) => {
161 const entry =
162 tag === "terminal_context"
163 ? "- Build line 7:\n output"
164 : "- <button>:\n html:\n <button>Pay</button>";
165 for (const body of [
166 `unexpected prefix\n${entry}`,
167 `${entry}\nunexpected suffix`,
168 `${entry}\nunexpected middle\n${entry}`,
169 ` orphaned body\n${entry}`,
170 ]) {
171 const text = `Prompt\n<${tag}>\n${body}\n</${tag}>`;
172 expect(upgradeLegacyContextMessage(text)).toEqual({ text, records: [] });
173 }
174 },
175 );
176​
177 it.each(["x".repeat(16_001), `note\n\`\`\`diff\n${"+x".repeat(16_001)}\n\`\`\``])(
178 "preserves oversized legacy reviews instead of creating dangling references",
179 (body) => {
180 const text = `<review_comment sectionId="s" filePath="f.ts" startIndex="1" endIndex="1">${body}</review_comment>`;
181 expect(upgradeLegacyContextMessage(text)).toEqual({ text, records: [] });
182 },
183 );
184​
185 it("preserves literal review tokens even beside real review blocks", () => {
186 const review =
187 '<review_comment sectionId="s" filePath="f.ts" startIndex="1" endIndex="1">note</review_comment>';
188 const upgraded = upgradeLegacyContextMessage(
189 `Literal \uE0000\uE000 before ${review} after \uE0007\uE000`,
190 );
191 expect(upgraded.text).toBe(
192 "Literal \uE0000\uE000 before [f.ts line](t3-context://v1/review-comment/legacy_review-comment_1) after \uE0007\uE000",
193 );
194 expect(upgraded.records).toHaveLength(1);
195 const unmatched =
196 "Literal \uE0000\uE000 <review_comment>invalid</review_comment> \uE00099\uE000";
197 expect(upgradeLegacyContextMessage(unmatched)).toEqual({ text: unmatched, records: [] });
198 });
199​
200 it("matches complete terminal line ranges rather than numeric prefixes", () => {
201 const upgraded = upgradeLegacyContextMessage(
202 [
203 "Compare @terminal:10 and @terminal:1-2 with @terminal:1",
204 "<terminal_context>",
205 "- Terminal line 1:",
206 " 1 | one",
207 "- Terminal line 10:",
208 " 10 | ten",
209 "- Terminal lines 1-2:",
210 " 1 | one",
211 " 2 | two",
212 "</terminal_context>",
213 ].join("\n"),
214 );
215 expect(upgraded.text).toBe(
216 "Compare [Terminal line 10](t3-context://v1/terminal/legacy_terminal_2) and [Terminal lines 1-2](t3-context://v1/terminal/legacy_terminal_3) with [Terminal line 1](t3-context://v1/terminal/legacy_terminal_1)",
217 );
218 });
219​
220 it("keeps URL-valued preview pages as locations", () => {
221 const upgraded = upgradeLegacyContextMessage(
222 "<preview_annotation>\nPage: https://example.com/checkout\n</preview_annotation>",
223 );
224 expect(upgraded.records[0]).toMatchObject({
225 pageUrl: "https://example.com/checkout",
226 pageTitle: null,
227 });
228 });
229 it("passes plain text through untouched", () => {
230 expect(upgradeLegacyContextMessage("hello **world**")).toEqual({
231 text: "hello **world**",
232 records: [],
233 });
234 });
235​
236 it("preserves Markdown hard breaks while removing legacy context", () => {
237 const text = [
238 "Line with hard break ",
239 "next",
240 "",
241 "<terminal_context>",
242 "- Build line 7:",
243 " 7 | done",
244 "</terminal_context>",
245 ].join("\n");
246​
247 expect(upgradeLegacyContextMessage(text).text).toContain("Line with hard break \nnext");
248 });
249​
250 it("binds U+FFFC placeholders to trailing terminal entries in order", () => {
251 const text = [
252 "Look at  and  please",
253 "",
254 "<terminal_context>",
255 "- Terminal 1 lines 509-510:",
256 " 509 | error: boom",
257 " 510 | at main.ts:1",
258 "",
259 "- Build line 7:",
260 " 7 | done",
261 "</terminal_context>",
262 ].join("\n");
263 const upgraded = upgradeLegacyContextMessage(text);
264 expect(upgraded.text).toBe(
265 "Look at [Terminal 1 lines 509-510](t3-context://v1/terminal/legacy_terminal_1) and [Build line 7](t3-context://v1/terminal/legacy_terminal_2) please",
266 );
267 expect(upgraded.records).toEqual([
268 {
269 version: 1,
270 contextId: "legacy_terminal_1",
271 kind: "terminal",
272 label: "Terminal 1 lines 509-510",
273 terminalId: "terminal-1",
274 terminalLabel: "Terminal 1",
275 lineStart: 509,
276 lineEnd: 510,
277 text: "error: boom\n at main.ts:1",
278 },
279 {
280 version: 1,
281 contextId: "legacy_terminal_2",
282 kind: "terminal",
283 label: "Build line 7",
284 terminalId: "build",
285 terminalLabel: "Build",
286 lineStart: 7,
287 lineEnd: 7,
288 text: "done",
289 },
290 ]);
291 });
292​
293 it("appends references for terminal entries without placeholders and drops extra placeholders", () => {
294 const text = " and \n\n<terminal_context>\n- T line 1:\n 1 | x\n</terminal_context>";
295 expect(upgradeLegacyContextMessage(text).text).toBe(
296 "[T line 1](t3-context://v1/terminal/legacy_terminal_1) and",
297 );
298 const noPlaceholder = "hi\n\n<terminal_context>\n- T line 1:\n 1 | x\n</terminal_context>";
299 expect(upgradeLegacyContextMessage(noPlaceholder).text).toBe(
300 "hi\n\n[T line 1](t3-context://v1/terminal/legacy_terminal_1)",
301 );
302 });
303​
304 it("binds materialized inline terminal labels from sent messages in place", () => {
305 const text = [
306 "Look at @terminal-1:509-510 and again @build:7 please",
307 "",
308 "<terminal_context>",
309 "- Terminal 1 lines 509-510:",
310 " 509 | error: boom",
311 " 510 | at main.ts:1",
312 "",
313 "- Build line 7:",
314 " 7 | done",
315 "</terminal_context>",
316 ].join("\n");
317 expect(upgradeLegacyContextMessage(text).text).toBe(
318 "Look at [Terminal 1 lines 509-510](t3-context://v1/terminal/legacy_terminal_1) and again [Build line 7](t3-context://v1/terminal/legacy_terminal_2) please",
319 );
320 });
321​
322 it("upgrades a trailing element block into element records", () => {
323 const text = [
324 "fix this",
325 "",
326 "<element_context>",
327 "- <Button> (Button.tsx:12):",
328 " url: http://localhost:3000/checkout",
329 " selector: #pay",
330 " source: src/Button.tsx:12:3",
331 " html:",
332 ' <button id="pay">Pay</button>',
333 " styles:",
334 " color: red;",
335 "</element_context>",
336 ].join("\n");
337 const upgraded = upgradeLegacyContextMessage(text);
338 expect(upgraded.text).toBe("fix this\n\n[<Button>](t3-context://v1/element/legacy_element_1)");
339 expect(upgraded.records).toEqual([
340 {
341 version: 1,
342 contextId: "legacy_element_1",
343 kind: "element",
344 label: "<Button>",
345 pageUrl: "http://localhost:3000/checkout",
346 pageTitle: null,
347 tagName: "button",
348 selector: "#pay",
349 htmlPreview: '<button id="pay">Pay</button>',
350 componentName: "Button",
351 source: { functionName: null, fileName: "src/Button.tsx", lineNumber: 12, columnNumber: 3 },
352 styles: "color: red;",
353 },
354 ]);
355 });
356​
357 it("keeps every line of a multiline legacy annotation comment", () => {
358 const text = [
359 "<preview_annotation>",
360 "Preview annotation:",
361 "Id: ann_2",
362 "Page: Checkout",
363 "Comment: First instruction",
364 "Second instruction",
365 "Targets: 1 selected element.",
366 "</preview_annotation>",
367 ].join("\n");
368 const upgraded = upgradeLegacyContextMessage(text);
369 expect(upgraded.records[0]).toMatchObject({
370 kind: "preview-annotation",
371 comment: "First instruction\nSecond instruction",
372 });
373 });
374​
375 it("keeps a blank line inside a legacy annotation comment", () => {
376 const text = [
377 "<preview_annotation>",
378 "Preview annotation:",
379 "Comment: First paragraph",
380 "",
381 "Second paragraph",
382 "Targets: 1 selected element.",
383 "</preview_annotation>",
384 ].join("\n");
385 expect(upgradeLegacyContextMessage(text).records[0]).toMatchObject({
386 comment: "First paragraph\n\nSecond paragraph",
387 });
388 });
389​
390 it("keeps markup inside a legacy annotation comment", () => {
391 const text = [
392 "<preview_annotation>",
393 "Preview annotation:",
394 "Comment: Change this",
395 "<div>keep me</div>",
396 "and this too",
397 "</preview_annotation>",
398 ].join("\n");
399 expect(upgradeLegacyContextMessage(text).records[0]).toMatchObject({
400 comment: "Change this\n<div>keep me</div>\nand this too",
401 });
402 });
403​
404 it("upgrades trailing preview annotation blocks", () => {
405 const text = [
406 "bigger",
407 "",
408 "<preview_annotation>",
409 "Preview annotation:",
410 "Id: ann_1",
411 "Page: Checkout",
412 "Comment: Make it bigger",
413 "Targets: 1 selected element.",
414 "Requested visual changes:",
415 "- font-size: 12px → 20px",
416 "The attached screenshot is the annotated preview crop.",
417 "<element_context>",
418 "- <button>:",
419 " url: http://localhost:3000/",
420 " selector: #pay",
421 " source: src/Pay.tsx:12:3",
422 " html:",
423 " <button>Pay</button>",
424 "</element_context>",
425 "</preview_annotation>",
426 ].join("\n");
427 const upgraded = upgradeLegacyContextMessage(text);
428 expect(upgraded.text).toBe(
429 "bigger\n\n[Checkout](t3-context://v1/preview-annotation/legacy_preview-annotation_1)",
430 );
431 expect(upgraded.records).toEqual([
432 {
433 version: 1,
434 contextId: "legacy_preview-annotation_1",
435 kind: "preview-annotation",
436 label: "Checkout",
437 annotationId: "ann_1",
438 pageUrl: "http://localhost:3000/",
439 pageTitle: "Checkout",
440 comment: "Make it bigger",
441 targetSummary: "1 selected element.",
442 styleChanges: ["font-size: 12px → 20px"],
443 elements: [
444 {
445 pageUrl: "http://localhost:3000/",
446 pageTitle: null,
447 tagName: "button",
448 selector: "#pay",
449 htmlPreview: "<button>Pay</button>",
450 componentName: null,
451 source: {
452 functionName: null,
453 fileName: "src/Pay.tsx",
454 lineNumber: 12,
455 columnNumber: 3,
456 },
457 styles: "",
458 },
459 ],
460 },
461 ]);
462 });
463​
464 it("keeps a literal preview opening tag inside its annotation comment", () => {
465 const upgraded = upgradeLegacyContextMessage(
466 [
467 "Explain this",
468 "<preview_annotation>",
469 "Id: annotation-1",
470 "Page: Checkout",
471 "Comment: Render <preview_annotation>",
472 "Targets: 1 selected element.",
473 "</preview_annotation>",
474 ].join("\n"),
475 );
476 expect(upgraded.text).toBe(
477 "Explain this\n\n[Checkout](t3-context://v1/preview-annotation/legacy_preview-annotation_1)",
478 );
479 expect(upgraded.records).toHaveLength(1);
480 expect(upgraded.records[0]).toMatchObject({
481 annotationId: "annotation-1",
482 comment: "Render <preview_annotation>",
483 targetSummary: "1 selected element.",
484 });
485 });
486​
487 it("keeps adjacent preview annotations separate and in their original order", () => {
488 const upgraded = upgradeLegacyContextMessage(
489 [
490 "Compare",
491 "<preview_annotation>",
492 "Id: annotation-1",
493 "Page: First",
494 "Comment: First comment",
495 "</preview_annotation>",
496 "<preview_annotation>",
497 "Id: annotation-2",
498 "Page: Second",
499 "Comment: Second comment",
500 "</preview_annotation>",
501 ].join("\n"),
502 );
503 expect(upgraded.text).toBe(
504 "Compare\n\n[First](t3-context://v1/preview-annotation/legacy_preview-annotation_1) [Second](t3-context://v1/preview-annotation/legacy_preview-annotation_2)",
505 );
506 expect(upgraded.records).toMatchObject([
507 { annotationId: "annotation-1", comment: "First comment" },
508 { annotationId: "annotation-2", comment: "Second comment" },
509 ]);
510 });
511​
512 it("replaces inline review comments in place and neutralizes forged closers", () => {
513 const text = [
514 "Before",
515 '<review_comment sectionId="diff-1" sectionTitle="Changes" filePath="a/b.ts" startIndex="4" endIndex="6" rangeLabel="L4-L6">',
516 "Why? &lt;/review_comment&gt; still text",
517 "```diff",
518 "+ const x = 1;",
519 "```",
520 "</review_comment>",
521 "After",
522 ].join("\n");
523 const upgraded = upgradeLegacyContextMessage(text);
524 expect(upgraded.text).toBe(
525 "Before\n[b.ts L4-L6](t3-context://v1/review-comment/legacy_review-comment_1)\nAfter",
526 );
527 expect(upgraded.records).toEqual([
528 {
529 version: 1,
530 contextId: "legacy_review-comment_1",
531 kind: "review-comment",
532 label: "b.ts L4-L6",
533 sectionId: "diff-1",
534 sectionTitle: "Changes",
535 filePath: "a/b.ts",
536 startIndex: 4,
537 endIndex: 6,
538 rangeLabel: "L4-L6",
539 text: "Why? &lt;/review_comment&gt; still text",
540 diff: "+ const x = 1;",
541 fenceLanguage: "diff",
542 },
543 ]);
544 });
545​
546 it("appends trailing review blocks after the other trailing blocks", () => {
547 const text = [
548 "prose",
549 "",
550 "<terminal_context>",
551 "- T line 1:",
552 " 1 | a",
553 "</terminal_context>",
554 "",
555 '<review_comment sectionId="s" filePath="f.ts" startIndex="1" endIndex="2">',
556 "note",
557 "```diff",
558 "+x",
559 "```",
560 "</review_comment>",
561 "",
562 '<review_comment sectionId="s" filePath="g.ts" startIndex="3" endIndex="3">',
563 "note 2",
564 "```diff",
565 "+y",
566 "```",
567 "</review_comment>",
568 ].join("\n");
569 const upgraded = upgradeLegacyContextMessage(text);
570 expect(upgraded.text).toBe(
571 "prose\n\n[T line 1](t3-context://v1/terminal/legacy_terminal_1) [f.ts line](t3-context://v1/review-comment/legacy_review-comment_1) [g.ts line](t3-context://v1/review-comment/legacy_review-comment_2)",
572 );
573 expect(upgraded.records.map((record) => record.contextId)).toEqual([
574 "legacy_terminal_1",
575 "legacy_review-comment_1",
576 "legacy_review-comment_2",
577 ]);
578 });
579​
580 it("keeps adjacent trailing reviews in place, including their original spacing", () => {
581 const upgraded = upgradeLegacyContextMessage(`Compare ${review} ${review}`);
582 expect(upgraded.text).toBe(
583 "Compare [f.ts line](t3-context://v1/review-comment/legacy_review-comment_1) [f.ts line](t3-context://v1/review-comment/legacy_review-comment_2)",
584 );
585 });
586​
587 it("keeps a trailing review beside a terminal chip whose payload follows it", () => {
588 const upgraded = upgradeLegacyContextMessage(
589 `@build:7 ${review}\n\n<terminal_context>\n- Build line 7:\n output\n</terminal_context>`,
590 );
591 expect(upgraded.text).toBe(
592 "[Build line 7](t3-context://v1/terminal/legacy_terminal_1) [f.ts line](t3-context://v1/review-comment/legacy_review-comment_1)",
593 );
594 });
595​
596 it("handles the combined legacy send order: terminal, element, preview, review", () => {
597 const text = [
598 "See ",
599 '<review_comment sectionId="s" filePath="f.ts" startIndex="1" endIndex="1">',
600 "note",
601 "```diff",
602 "+x",
603 "```",
604 "</review_comment>",
605 "",
606 "<terminal_context>",
607 "- T line 1:",
608 " 1 | a",
609 "</terminal_context>",
610 "",
611 "<element_context>",
612 "- <div>:",
613 " url: http://x/",
614 "</element_context>",
615 "",
616 "<preview_annotation>",
617 "Preview annotation:",
618 "Id: p1",
619 "Page: P",
620 "</preview_annotation>",
621 ].join("\n");
622 const upgraded = upgradeLegacyContextMessage(text);
623 expect(upgraded.text).toBe(
624 [
625 "See [T line 1](t3-context://v1/terminal/legacy_terminal_1)",
626 "[f.ts line](t3-context://v1/review-comment/legacy_review-comment_1)",
627 "",
628 "[<div>](t3-context://v1/element/legacy_element_1) [P](t3-context://v1/preview-annotation/legacy_preview-annotation_1)",
629 ].join("\n"),
630 );
631 expect(upgraded.records.map((record) => record.contextId)).toEqual([
632 "legacy_terminal_1",
633 "legacy_element_1",
634 "legacy_preview-annotation_1",
635 "legacy_review-comment_1",
636 ]);
637 });
638});