Expose builder chip selection beyond color, raise unselected contrast, and make the five-value limit visible.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -125,4 +125,32 @@ describe("ApplicableScopeField behavior", () => {
|
||||
|
||||
expect(screen.queryByAltText("Help")).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("exposes selected state on chips and keeps unselected chips enabled", () => {
|
||||
renderWithProviders(<ApplicableScopeField {...baseProps} />);
|
||||
|
||||
const selected = screen.getByRole("button", { name: /Deselect Finance/i });
|
||||
const unselected = screen.getByRole("button", {
|
||||
name: /Select Operations/i,
|
||||
});
|
||||
|
||||
expect(selected).toHaveAttribute("aria-pressed", "true");
|
||||
expect(selected).toBeEnabled();
|
||||
expect(unselected).toHaveAttribute("aria-pressed", "false");
|
||||
expect(unselected).toBeEnabled();
|
||||
});
|
||||
|
||||
it("uses a real disabled state when readOnly", () => {
|
||||
renderWithProviders(<ApplicableScopeField {...baseProps} readOnly />);
|
||||
|
||||
expect(
|
||||
screen.getByRole("button", { name: /Deselect Finance/i }),
|
||||
).toBeDisabled();
|
||||
expect(
|
||||
screen.getByRole("button", { name: /Select Operations/i }),
|
||||
).toBeDisabled();
|
||||
expect(
|
||||
screen.queryByRole("button", { name: /Add Applicable Scope/i }),
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user