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:
parent
4676af4e39
commit
325ac536cd
1 changed files with 6 additions and 6 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Reference in a new issue