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:
adilallo
2026-09-10 09:04:06 -06:00
co-authored by Cursor
parent 95e1937419
commit 64a2ef5a00
16 changed files with 266 additions and 51 deletions
@@ -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();
});
});