test(web): resolve the null defaults from the schema, not a seeded value

Copilot review: seeding `{ b: null }` / `{ cfg: null }` meant the schema's
`default: null` was never resolved, so a regression that dropped null defaults
would have left both #1885 tests green while claiming to pin that path. Render
the harness unseeded instead, which is also how the reporter's form arrived.

Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
cliffhall 2026-08-15 23:59:31 -04:00
commit 325ac536cd

View file

@ -1602,9 +1602,9 @@ describe("JSON editor escaping (#1853, #1856, #1885)", () => {
},
required: ["a"],
};
renderWithMantine(
<EscapingHarness schema={schema} initial={{ b: null }} />,
);
// No seeded value: the `null` has to come from the schema's `default`,
// which is where the reporter's did.
renderWithMantine(<EscapingHarness schema={schema} />);
const b = screen.getByLabelText(/^B$/) as HTMLInputElement;
expect(b.tagName).toBe("INPUT");
@ -1632,9 +1632,9 @@ describe("JSON editor escaping (#1853, #1856, #1885)", () => {
},
},
};
renderWithMantine(
<EscapingHarness schema={schema} initial={{ cfg: null }} />,
);
// Again unseeded, so the editor's opening `null` is the schema default
// being resolved — the state the reporter's recording starts from.
renderWithMantine(<EscapingHarness schema={schema} />);
const jsonInput = screen.getByLabelText(/Cfg/) as HTMLTextAreaElement;
expect(jsonInput.value).toBe("null");