fix: paint chips inline so native button styles cannot override Figma colors
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -41,6 +41,16 @@ describe("Chip", () => {
|
||||
expect(chip.querySelector("svg")).toBeNull();
|
||||
});
|
||||
|
||||
it("paints unselected chips on the element so native button styles cannot win", () => {
|
||||
render(<Chip label="Worker cooperative" state="unselected" />);
|
||||
const chip = screen.getByRole("button", { name: "Worker cooperative" });
|
||||
expect(chip.style.color).toContain("--color-content-default-brand-primary");
|
||||
expect(chip.style.backgroundColor).toBe("transparent");
|
||||
expect(chip.style.borderColor).toContain(
|
||||
"--color-border-default-tertiary",
|
||||
);
|
||||
});
|
||||
|
||||
it("exposes aria-pressed and a check mark when selected", () => {
|
||||
render(<Chip label="Worker cooperative" state="selected" />);
|
||||
const chip = screen.getByRole("button", { name: "Worker cooperative" });
|
||||
|
||||
Reference in New Issue
Block a user