Skip to content

Commit 7222d54

Browse files
ryansolidClaude via Cursor
andcommitted
test(web): silence TS2783 on the intentional duplicate value in the spread specs
Co-authored-by: Claude via Cursor <[email protected]>
1 parent 0c3bc2a commit 7222d54

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎packages/web/test/server/spread-static-text.spec.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ const stripKeys = (html: string) => html.replace(/ _hk=[^\s>]+/g, "");
1212
const render = (code: () => any) => stripKeys(renderToString(code));
1313

1414
const rest = { id: "a" };
15-
const withValue = { id: "a", value: "from-spread" };
15+
// Widened so TS cannot see the duplicate `value` key (TS2783) — the collision
16+
// between the explicit attribute and the spread is the case under test.
17+
const withValue: Record<string, string> = { id: "a", value: "from-spread" };
1618

1719
describe("static text on spread elements (#3557)", () => {
1820
test("a static text child is escaped", () => {

‎packages/web/test/spread-static-text.spec.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ import { createRoot, flush } from "solid-js";
1010
// static textarea `value` keeps its source order against the spread.
1111

1212
const rest = { id: "a" };
13-
const withValue = { id: "a", value: "from-spread" };
13+
// Widened so TS cannot see the duplicate `value` key (TS2783) — the collision
14+
// between the explicit attribute and the spread is the case under test.
15+
const withValue: Record<string, string> = { id: "a", value: "from-spread" };
1416

1517
function mount<T extends Element>(code: () => any): T {
1618
let el!: T;

0 commit comments

Comments
 (0)