fix: harden phase summary open questions
This commit is contained in:
@@ -81,6 +81,22 @@ test("renders open_questions as a bullet list", () => {
|
||||
expect(screen.getByText("Serve confermare la finestra temporale?")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test("renders a legacy structured open question safely", () => {
|
||||
const malformed = {
|
||||
...phase,
|
||||
open_questions: [
|
||||
{
|
||||
label: "pazienti_finale restituisce 0 righe",
|
||||
question: "Verificare se i filtri sono troppo restrittivi",
|
||||
},
|
||||
],
|
||||
} as unknown as PhaseSummaryV2;
|
||||
|
||||
render(<PhaseSummaryViewer phase={malformed} />);
|
||||
|
||||
expect(screen.getByText("Verificare se i filtri sono troppo restrittivi")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test("renders a section with title only (no items key) without crashing", () => {
|
||||
const proseOnly: PhaseSummaryV2 = {
|
||||
schema_version: 2,
|
||||
|
||||
Reference in New Issue
Block a user