test(ui): strengthen disabled cursor assertions and fix linting

This commit is contained in:
Yunxiao Xu
2026-02-23 05:46:44 -08:00
parent 322ae1e7c8
commit e7be0dbeca
2 changed files with 21 additions and 8 deletions

View File

@@ -23,9 +23,7 @@ describe("Button component", () => {
render(<Button disabled>Disabled Button</Button>)
const button = screen.getByRole("button", { name: /disabled button/i })
expect(button).toBeDisabled()
// It should have cursor-pointer but also disabled:pointer-events-none
// which prevents the cursor from changing.
// We can also add disabled:cursor-default for clarity.
expect(button).toHaveClass("disabled:pointer-events-none")
expect(button).toHaveClass("disabled:cursor-default")
})
})