Skip to content

Commit

Permalink
fix(web): use expected role in the test
Browse files Browse the repository at this point in the history
Switch instead checkbox
  • Loading branch information
dgdavid committed Jan 10, 2025
1 parent 7d6c77d commit b141c74
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/src/components/storage/SnapshotsField.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ describe("SnapshotsField", () => {
it("reflects snapshots status", () => {
props = { rootVolume: { ...rootVolume, snapshots: true }, onChange: onChangeFn };
plainRender(<SnapshotsField {...props} />);
const checkbox: HTMLInputElement = screen.getByRole("checkbox");
const checkbox: HTMLInputElement = screen.getByRole("switch");
expect(checkbox.value).toEqual("on");
});

it("allows toggling snapshots status", async () => {
props = { rootVolume: { ...rootVolume, snapshots: true }, onChange: onChangeFn };
const { user } = plainRender(<SnapshotsField {...props} />);
const checkbox: HTMLInputElement = screen.getByRole("checkbox");
const checkbox: HTMLInputElement = screen.getByRole("switch");
await user.click(checkbox);
expect(onChangeFn).toHaveBeenCalledWith({ active: false });
});
Expand Down

0 comments on commit b141c74

Please sign in to comment.