fix(ui): resolve disabled state cursor regression and add dropdown tests

This commit is contained in:
Yunxiao Xu
2026-02-23 05:39:32 -08:00
parent 46b57d2a73
commit 322ae1e7c8
6 changed files with 104 additions and 6 deletions

View File

@@ -18,4 +18,14 @@ describe("Button component", () => {
button = screen.getByRole("button", { name: /destructive/i })
expect(button).toHaveClass("cursor-pointer")
})
it("renders with a default cursor when disabled", () => {
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")
})
})