the assigned sources list is a rac checkboxgroup and safe search uses the same drawn checkbox, extracted to a shared ui component with grouped and standalone modes enforced by a discriminated union. the label carries a 44px pointer-target floor on both axes, the focus ring is driven from rac's focus-visible state and guarded by a test, and toggleSource is gone because the group hands back the whole set.
9 lines
280 B
TypeScript
9 lines
280 B
TypeScript
import { sameSet } from "./sourceSet";
|
|
|
|
test("sameSet compares regardless of order", () => {
|
|
expect(sameSet([1, 2, 3], [3, 1, 2])).toBe(true);
|
|
expect(sameSet([], [])).toBe(true);
|
|
expect(sameSet([1, 2], [1, 2, 3])).toBe(false);
|
|
expect(sameSet([1, 2], [1, 4])).toBe(false);
|
|
});
|