Skip to content

Commit

Permalink
Add a test confirming readOnly stops interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
Myranae committed Aug 7, 2024
1 parent b2fafd4 commit f415144
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/perseus/src/widgets/__tests__/interactive-graph.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,26 @@ describe("a mafs graph", () => {
{timeout: 5000},
);
});

it("is marked invalid when readOnly set to true", async () => {
const {renderer} = renderQuestion(question, {
...apiOptions,
readOnly: true,
});

await userEvent.tab();

// Act
await userEvent.keyboard("{arrowup}{arrowdown}");

// Assert
await waitFor(
() => {
expect(renderer).toHaveInvalidInput();
},
{timeout: 5000},
);
});
},
);

Expand Down

0 comments on commit f415144

Please sign in to comment.