diff --git a/.storybook/fonts.css b/.storybook/fonts.css index 7f3782b..8cc0b88 100644 --- a/.storybook/fonts.css +++ b/.storybook/fonts.css @@ -1,7 +1,7 @@ @import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"); :root { - --font-inter: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", - Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", - "Segoe UI Emoji"; + --font-inter: + "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, + "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji"; } diff --git a/app/components/Checkbox.js b/app/components/Checkbox.js index 05c494e..3423b5f 100644 --- a/app/components/Checkbox.js +++ b/app/components/Checkbox.js @@ -83,7 +83,8 @@ const Checkbox = memo( }; // Generate unique ID for accessibility if not provided - const checkboxId = id || `checkbox-${useId()}`; + const generatedId = useId(); + const checkboxId = id || `checkbox-${generatedId}`; const accessibilityProps = { role: "checkbox", diff --git a/app/components/ContextMenu.js b/app/components/ContextMenu.js index 7a7eb25..1498910 100644 --- a/app/components/ContextMenu.js +++ b/app/components/ContextMenu.js @@ -28,7 +28,7 @@ const ContextMenu = forwardRef( {children} ); - } + }, ); ContextMenu.displayName = "ContextMenu"; diff --git a/app/components/ContextMenuItem.js b/app/components/ContextMenuItem.js index 795e08a..b84d462 100644 --- a/app/components/ContextMenuItem.js +++ b/app/components/ContextMenuItem.js @@ -14,7 +14,7 @@ const ContextMenuItem = forwardRef( size = "medium", ...props }, - ref + ref, ) => { const getTextSize = () => { switch (size) { @@ -57,7 +57,7 @@ const ContextMenuItem = forwardRef( onClick(e); } }, - [disabled, onClick] + [disabled, onClick], ); const handleKeyDown = useCallback( @@ -69,7 +69,7 @@ const ContextMenuItem = forwardRef( } } }, - [disabled, onClick] + [disabled, onClick], ); return ( @@ -119,7 +119,7 @@ const ContextMenuItem = forwardRef( )} ); - } + }, ); ContextMenuItem.displayName = "ContextMenuItem"; diff --git a/app/components/ContextMenuSection.js b/app/components/ContextMenuSection.js index c4bac76..2592ae3 100644 --- a/app/components/ContextMenuSection.js +++ b/app/components/ContextMenuSection.js @@ -22,7 +22,7 @@ const ContextMenuSection = forwardRef( {children} ); - } + }, ); ContextMenuSection.displayName = "ContextMenuSection"; diff --git a/app/components/Input.js b/app/components/Input.js index 5afeee7..d86af2f 100644 --- a/app/components/Input.js +++ b/app/components/Input.js @@ -22,7 +22,7 @@ const Input = forwardRef( className = "", ...props }, - ref + ref, ) => { // Generate unique ID for accessibility if not provided const generatedId = useId(); @@ -127,7 +127,7 @@ const Input = forwardRef( onChange(e); } }, - [disabled, onChange] + [disabled, onChange], ); const handleFocus = useCallback( @@ -136,7 +136,7 @@ const Input = forwardRef( onFocus(e); } }, - [disabled, onFocus] + [disabled, onFocus], ); const handleBlur = useCallback( @@ -145,7 +145,7 @@ const Input = forwardRef( onBlur(e); } }, - [disabled, onBlur] + [disabled, onBlur], ); return ( @@ -177,7 +177,7 @@ const Input = forwardRef( ); - } + }, ); Input.displayName = "Input"; diff --git a/app/components/RadioButton.js b/app/components/RadioButton.js index 9845dc5..d12e234 100644 --- a/app/components/RadioButton.js +++ b/app/components/RadioButton.js @@ -71,7 +71,8 @@ const RadioButton = ({ "focus:outline focus:outline-1 focus:outline-[var(--color-border-default-utility-info)] focus:shadow-[0_0_10px_1px_var(--color-surface-inverse-brand-primary)]"; // Generate unique ID for accessibility if not provided - const radioId = id || `radio-${useId()}`; + const generatedId = useId(); + const radioId = id || `radio-${generatedId}`; const handleToggle = useCallback( (e) => { diff --git a/app/components/RadioGroup.js b/app/components/RadioGroup.js index 207b954..eff1a19 100644 --- a/app/components/RadioGroup.js +++ b/app/components/RadioGroup.js @@ -15,7 +15,8 @@ const RadioGroup = ({ ...props }) => { // Generate unique ID for accessibility if not provided - const groupId = name || `radio-group-${useId()}`; + const generatedId = useId(); + const groupId = name || `radio-group-${generatedId}`; const handleChange = useCallback( (optionValue) => { diff --git a/app/components/Select.js b/app/components/Select.js index 9db18b0..1cd5d7a 100644 --- a/app/components/Select.js +++ b/app/components/Select.js @@ -33,7 +33,8 @@ const Select = forwardRef( }, ref ) => { - const selectId = id || `select-${useId()}`; + const generatedId = useId(); + const selectId = id || `select-${generatedId}`; const labelId = `${selectId}-label`; const [isOpen, setIsOpen] = useState(false); const [selectedValue, setSelectedValue] = useState(value || ""); diff --git a/app/components/Switch.js b/app/components/Switch.js index e12fae0..7870e19 100644 --- a/app/components/Switch.js +++ b/app/components/Switch.js @@ -21,7 +21,7 @@ const Switch = memo( onChange(e); } }, - [onChange] + [onChange], ); const handleKeyDown = useCallback( @@ -33,7 +33,7 @@ const Switch = memo( } } }, - [onChange] + [onChange], ); const handleFocus = useCallback( @@ -42,7 +42,7 @@ const Switch = memo( onFocus(e); } }, - [onFocus] + [onFocus], ); const handleBlur = useCallback( @@ -51,7 +51,7 @@ const Switch = memo( onBlur(e); } }, - [onBlur] + [onBlur], ); // Switch track styles based on checked state @@ -155,7 +155,7 @@ const Switch = memo( {label && {label}} ); - }) + }), ); Switch.displayName = "Switch"; diff --git a/app/components/TextArea.js b/app/components/TextArea.js index 2d61a93..cf5ef6a 100644 --- a/app/components/TextArea.js +++ b/app/components/TextArea.js @@ -22,7 +22,7 @@ const TextArea = forwardRef( rows, ...props }, - ref + ref, ) => { // Generate unique ID for accessibility if not provided const generatedId = useId(); @@ -130,7 +130,7 @@ const TextArea = forwardRef( onChange(e); } }, - [disabled, onChange] + [disabled, onChange], ); const handleFocus = useCallback( @@ -139,7 +139,7 @@ const TextArea = forwardRef( onFocus(e); } }, - [disabled, onFocus] + [disabled, onFocus], ); const handleBlur = useCallback( @@ -148,7 +148,7 @@ const TextArea = forwardRef( onBlur(e); } }, - [disabled, onBlur] + [disabled, onBlur], ); return ( @@ -182,7 +182,7 @@ const TextArea = forwardRef( ); - } + }, ); TextArea.displayName = "TextArea"; diff --git a/app/components/Toggle.js b/app/components/Toggle.js index 01a04f4..19f815f 100644 --- a/app/components/Toggle.js +++ b/app/components/Toggle.js @@ -17,7 +17,7 @@ const Toggle = forwardRef( className = "", ...props }, - ref + ref, ) => { const toggleId = useId(); const labelId = useId(); @@ -120,7 +120,7 @@ const Toggle = forwardRef( onChange(e); } }, - [disabled, onChange] + [disabled, onChange], ); const handleFocus = useCallback( @@ -129,7 +129,7 @@ const Toggle = forwardRef( onFocus(e); } }, - [disabled, onFocus] + [disabled, onFocus], ); const handleBlur = useCallback( @@ -138,7 +138,7 @@ const Toggle = forwardRef( onBlur(e); } }, - [disabled, onBlur] + [disabled, onBlur], ); const handleKeyDown = useCallback( @@ -150,7 +150,7 @@ const Toggle = forwardRef( } } }, - [disabled, onChange] + [disabled, onChange], ); return ( @@ -186,7 +186,7 @@ const Toggle = forwardRef( ); - } + }, ); Toggle.displayName = "Toggle"; diff --git a/app/components/ToggleGroup.js b/app/components/ToggleGroup.js index 08ba1e3..2467522 100644 --- a/app/components/ToggleGroup.js +++ b/app/components/ToggleGroup.js @@ -55,7 +55,7 @@ const ToggleGroup = memo( onChange(e); } }, - [onChange] + [onChange], ); const handleFocus = useCallback( @@ -64,7 +64,7 @@ const ToggleGroup = memo( onFocus(e); } }, - [onFocus] + [onFocus], ); const handleBlur = useCallback( @@ -73,7 +73,7 @@ const ToggleGroup = memo( onBlur(e); } }, - [onBlur] + [onBlur], ); const handleKeyDown = useCallback( @@ -85,7 +85,7 @@ const ToggleGroup = memo( } } }, - [onChange] + [onChange], ); const toggleClasses = ` @@ -129,7 +129,7 @@ const ToggleGroup = memo( {showText ? children : children || "☰"} ); - }) + }), ); ToggleGroup.displayName = "ToggleGroup"; diff --git a/app/tailwind.css b/app/tailwind.css index 9c7c88e..b342fb7 100644 --- a/app/tailwind.css +++ b/app/tailwind.css @@ -31,12 +31,15 @@ --color-*: initial; /* Font families */ - --font-sans: var(--font-inter), ui-sans-serif, system-ui, -apple-system, + --font-sans: + var(--font-inter), ui-sans-serif, system-ui, -apple-system, "Segoe UI", + Roboto, "Helvetica Neue", Arial, sans-serif; + --font-display: + var(--font-bricolage-grotesque), ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; - --font-display: var(--font-bricolage-grotesque), ui-sans-serif, system-ui, - -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; - --font-mono: var(--font-space-grotesk), ui-monospace, SFMono-Regular, - "SF Mono", Consolas, "Liberation Mono", Menlo, monospace; + --font-mono: + var(--font-space-grotesk), ui-monospace, SFMono-Regular, "SF Mono", + Consolas, "Liberation Mono", Menlo, monospace; /* Dimension */ --spacing-scale-000: 0px; diff --git a/package-lock.json b/package-lock.json index bf07fce..1d58bd2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,6 +45,7 @@ "@vitest/coverage-v8": "^3.2.4", "eslint": "^9", "eslint-config-next": "15.2.0", + "eslint-plugin-storybook": "^9.0.7", "jest-axe": "^10.0.0", "jsdom": "^26.1.0", "msw": "^2.10.5", @@ -12438,6 +12439,24 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/eslint-plugin-storybook": { + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/eslint-plugin-storybook/-/eslint-plugin-storybook-9.0.7.tgz", + "integrity": "sha512-da9oIFo2ww+/PWAsTrpeEPUmhel6Ej1++SwBvdf+SV0H6+rOPbzJGOh367hdOvkwKCbGdKRmw+JmXFCQfHCpqw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@storybook/csf": "^0.1.11", + "@typescript-eslint/utils": "^8.8.1", + "ts-dedent": "^2.2.0" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "eslint": ">=8" + } + }, "node_modules/eslint-scope": { "version": "8.4.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", diff --git a/package.json b/package.json index 9d37eb6..09ddd60 100644 --- a/package.json +++ b/package.json @@ -80,6 +80,7 @@ "@vitest/coverage-v8": "^3.2.4", "eslint": "^9", "eslint-config-next": "15.2.0", + "eslint-plugin-storybook": "^9.0.7", "jest-axe": "^10.0.0", "jsdom": "^26.1.0", "msw": "^2.10.5", diff --git a/tests/accessibility/ContextMenu.a11y.test.jsx b/tests/accessibility/ContextMenu.a11y.test.jsx index f0ea17a..ede86bd 100644 --- a/tests/accessibility/ContextMenu.a11y.test.jsx +++ b/tests/accessibility/ContextMenu.a11y.test.jsx @@ -17,7 +17,7 @@ describe("ContextMenu Components Accessibility", () => { Item 1 Item 2 - + , ); const results = await axe(container); expect(results).toHaveNoViolations(); @@ -28,7 +28,7 @@ describe("ContextMenu Components Accessibility", () => { Item 1 Item 2 - + , ); const menu = screen.getByRole("menu"); @@ -44,7 +44,7 @@ describe("ContextMenu Components Accessibility", () => { Item 1 Item 2 - + , ); const firstItem = screen.getByRole("menuitem", { name: "Item 1" }); @@ -58,7 +58,7 @@ describe("ContextMenu Components Accessibility", () => { const { container } = render( Test Item - + , ); const results = await axe(container); expect(results).toHaveNoViolations(); @@ -68,7 +68,7 @@ describe("ContextMenu Components Accessibility", () => { render( Test Item - + , ); const item = screen.getByRole("menuitem"); @@ -81,7 +81,7 @@ describe("ContextMenu Components Accessibility", () => { Test Item - + , ); const item = screen.getByRole("menuitem"); @@ -94,7 +94,7 @@ describe("ContextMenu Components Accessibility", () => { render( Test Item - + , ); const item = screen.getByRole("menuitem"); @@ -110,7 +110,7 @@ describe("ContextMenu Components Accessibility", () => { render( Test Item - + , ); const item = screen.getByRole("menuitem"); @@ -124,12 +124,12 @@ describe("ContextMenu Components Accessibility", () => { render( Test Item - + , ); const item = screen.getByRole("menuitem"); expect(item).toHaveClass( - "hover:!bg-[var(--color-surface-default-secondary)]" + "hover:!bg-[var(--color-surface-default-secondary)]", ); }); @@ -139,7 +139,7 @@ describe("ContextMenu Components Accessibility", () => { Test Item - + , ); const item = screen.getByRole("menuitem"); @@ -154,7 +154,7 @@ describe("ContextMenu Components Accessibility", () => { Item 1 - + , ); const results = await axe(container); expect(results).toHaveNoViolations(); @@ -166,7 +166,7 @@ describe("ContextMenu Components Accessibility", () => { Item 1 - + , ); const title = screen.getByText("Test Section"); @@ -179,7 +179,7 @@ describe("ContextMenu Components Accessibility", () => { Item 1 - + , ); const title = screen.getByText("Test Section"); @@ -206,7 +206,7 @@ describe("ContextMenu Components Accessibility", () => { const divider = screen.getByRole("separator"); expect(divider).toHaveClass( - "border-[var(--color-border-default-tertiary)]" + "border-[var(--color-border-default-tertiary)]", ); }); }); @@ -268,7 +268,7 @@ describe("ContextMenu Components Accessibility", () => { Item 1 Item 2 - + , ); const items = screen.getAllByRole("menuitem"); @@ -284,12 +284,12 @@ describe("ContextMenu Components Accessibility", () => { render( Test Item - + , ); const item = screen.getByRole("menuitem"); expect(item).toHaveClass( - "text-[var(--color-content-default-brand-primary)]" + "text-[var(--color-content-default-brand-primary)]", ); }); @@ -297,7 +297,7 @@ describe("ContextMenu Components Accessibility", () => { render( - + , ); const title = screen.getByText("Test Section"); @@ -308,12 +308,12 @@ describe("ContextMenu Components Accessibility", () => { render( - + , ); const divider = screen.getByRole("separator"); expect(divider).toHaveClass( - "border-[var(--color-border-default-tertiary)]" + "border-[var(--color-border-default-tertiary)]", ); }); }); @@ -328,7 +328,7 @@ describe("ContextMenu Components Accessibility", () => { Item 2 - + , ); const menu = screen.getByRole("menu"); @@ -344,7 +344,7 @@ describe("ContextMenu Components Accessibility", () => { const { rerender } = render( Test Item - + , ); const item = screen.getByRole("menuitem"); @@ -353,7 +353,7 @@ describe("ContextMenu Components Accessibility", () => { rerender( Test Item - + , ); expect(item).toHaveAttribute("aria-current", "true"); @@ -372,7 +372,7 @@ describe("ContextMenu Components Accessibility", () => { Item 3 - + , ); const results = await axe(container); expect(results).toHaveNoViolations(); @@ -390,7 +390,7 @@ describe("ContextMenu Components Accessibility", () => { Disabled Item - + , ); const results = await axe(container); expect(results).toHaveNoViolations(); diff --git a/tests/accessibility/Input.a11y.test.jsx b/tests/accessibility/Input.a11y.test.jsx index bea9129..47fb772 100644 --- a/tests/accessibility/Input.a11y.test.jsx +++ b/tests/accessibility/Input.a11y.test.jsx @@ -27,7 +27,7 @@ describe("Input Component Accessibility", () => { test("has no accessibility violations with horizontal label", async () => { const { container } = render( - + , ); const results = await axe(container); expect(results).toHaveNoViolations(); @@ -98,7 +98,7 @@ describe("Input Component Accessibility", () => {
-
+ , ); const firstInput = screen.getByLabelText("First input"); @@ -119,7 +119,7 @@ describe("Input Component Accessibility", () => {
-
+ , ); const firstInput = screen.getByLabelText("First input"); @@ -184,7 +184,7 @@ describe("Input Component Accessibility", () => { const handleBlur = vi.fn(); render( - + , ); const input = screen.getByRole("textbox"); @@ -206,7 +206,7 @@ describe("Input Component Accessibility", () => { render(
-
+ , ); const input = screen.getByRole("textbox"); @@ -219,7 +219,7 @@ describe("Input Component Accessibility", () => { label="Test input" aria-describedby="help-text" aria-required="true" - /> + />, ); const input = screen.getByRole("textbox"); @@ -239,7 +239,7 @@ describe("Input Component Accessibility", () => { - + , ); const firstInput = screen.getByLabelText("First input"); diff --git a/tests/accessibility/Select.a11y.test.jsx b/tests/accessibility/Select.a11y.test.jsx index 27dcbc6..8bfd6d2 100644 --- a/tests/accessibility/Select.a11y.test.jsx +++ b/tests/accessibility/Select.a11y.test.jsx @@ -272,7 +272,9 @@ describe("Select Component Accessibility", () => { render( - + , ); const textInput = screen.getByLabelText("Text Input"); @@ -210,7 +210,7 @@ describe("Input Component Integration", () => { size="large" labelVariant="horizontal" /> - + , ); // All inputs should be present @@ -231,7 +231,7 @@ describe("Input Component Integration", () => { onChange={handleChange} onFocus={vi.fn()} onBlur={vi.fn()} - /> + />, ); const input = screen.getByLabelText("Disabled Input"); @@ -252,7 +252,7 @@ describe("Input Component Integration", () => { const input = screen.getByLabelText("Error Input"); expect(input).toHaveClass( - "border-[var(--color-border-default-utility-negative)]" + "border-[var(--color-border-default-utility-negative)]", ); expect(input).not.toBeDisabled(); }); @@ -287,7 +287,7 @@ describe("Input Component Integration", () => { fireEvent.click(hoverButton); expect(input).toHaveClass("border-[var(--color-border-default-tertiary)]"); expect(input).toHaveClass( - "shadow-[0_0_0_2px_var(--color-border-default-tertiary)]" + "shadow-[0_0_0_2px_var(--color-border-default-tertiary)]", ); // Set active state @@ -297,7 +297,7 @@ describe("Input Component Integration", () => { // Focus state fireEvent.focus(input); expect(input).toHaveClass( - "border-[var(--color-border-default-utility-info)]" + "border-[var(--color-border-default-utility-info)]", ); expect(input).toHaveClass("shadow-[0_0_5px_3px_#3281F8]"); }); @@ -308,7 +308,7 @@ describe("Input Component Integration", () => { - + , ); const firstInput = screen.getByLabelText("First Input"); @@ -345,7 +345,7 @@ describe("Input Component Integration", () => {
-
+ , ); const input = screen.getByLabelText("Test Input"); @@ -408,7 +408,7 @@ describe("Input Component Integration", () => { // Initial state expect(input).not.toBeDisabled(); expect(input).not.toHaveClass( - "border-[var(--color-border-default-utility-negative)]" + "border-[var(--color-border-default-utility-negative)]", ); // Toggle disabled @@ -420,7 +420,7 @@ describe("Input Component Integration", () => { fireEvent.click(toggleErrorButton); // Turn on error // The error state applies the border color through the stateStyles.input class expect(input).toHaveClass( - "border-[var(--color-border-default-utility-negative)]" + "border-[var(--color-border-default-utility-negative)]", ); }); }); diff --git a/tests/integration/RadioButton.integration.test.jsx b/tests/integration/RadioButton.integration.test.jsx index e21ced7..0b57d8e 100644 --- a/tests/integration/RadioButton.integration.test.jsx +++ b/tests/integration/RadioButton.integration.test.jsx @@ -131,13 +131,13 @@ describe("RadioButton Integration", () => { // Initially standard mode expect(radioButton).toHaveClass( - "outline-[var(--color-border-default-tertiary)]" + "outline-[var(--color-border-default-tertiary)]", ); // Switch to inverse mode await user.click(toggleButton); expect(radioButton).toHaveClass( - "outline-[var(--color-border-inverse-primary)]" + "outline-[var(--color-border-inverse-primary)]", ); }); @@ -231,13 +231,13 @@ describe("RadioButton Integration", () => { await user.click(group1OptionB); await user.click(group2OptionY); - const group1Inputs = screen.getAllByDisplayValue("option2").filter( - input => input.getAttribute("name") === "group1" - ); - const group2Inputs = screen.getAllByDisplayValue("option2").filter( - input => input.getAttribute("name") === "group2" - ); - + const group1Inputs = screen + .getAllByDisplayValue("option2") + .filter((input) => input.getAttribute("name") === "group1"); + const group2Inputs = screen + .getAllByDisplayValue("option2") + .filter((input) => input.getAttribute("name") === "group2"); + expect(group1Inputs[0]).toBeChecked(); expect(group2Inputs[0]).toBeChecked(); }); @@ -309,13 +309,13 @@ describe("RadioButton Integration", () => { await user.click(controlledOption2); await user.click(uncontrolledOption2); - const controlledInputs = screen.getAllByDisplayValue("option2").filter( - input => input.getAttribute("name") === "controlled" - ); - const uncontrolledInputs = screen.getAllByDisplayValue("option2").filter( - input => input.getAttribute("name") === "uncontrolled" - ); - + const controlledInputs = screen + .getAllByDisplayValue("option2") + .filter((input) => input.getAttribute("name") === "controlled"); + const uncontrolledInputs = screen + .getAllByDisplayValue("option2") + .filter((input) => input.getAttribute("name") === "uncontrolled"); + expect(controlledInputs[0]).toBeChecked(); expect(uncontrolledInputs[0]).toBeChecked(); }); diff --git a/tests/integration/RadioGroup.integration.test.jsx b/tests/integration/RadioGroup.integration.test.jsx index c17f2a7..ba48dc5 100644 --- a/tests/integration/RadioGroup.integration.test.jsx +++ b/tests/integration/RadioGroup.integration.test.jsx @@ -14,10 +14,10 @@ describe("RadioGroup Integration", () => { it("works in form context", async () => { const user = userEvent.setup(); const handleSubmit = vi.fn(); - + function TestForm() { const [value, setValue] = useState("option1"); - + return (
{ it("handles keyboard navigation", async () => { const user = userEvent.setup(); const handleChange = vi.fn(); - + function KeyboardForm() { const [value, setValue] = useState("option1"); - + return ( { render(); const radioButtons = screen.getAllByRole("radio"); - + // Focus first radio button radioButtons[0].focus(); expect(radioButtons[0]).toHaveFocus(); - + // Navigate to second radio button await user.tab(); expect(radioButtons[1]).toHaveFocus(); - + // Activate with Space await user.keyboard(" "); expect(screen.getByDisplayValue("option2")).toBeChecked(); @@ -88,10 +88,14 @@ describe("RadioGroup Integration", () => { function ModeSwitchForm() { const [mode, setMode] = useState("standard"); const [value, setValue] = useState("option1"); - + return (
- { const toggleButton = screen.getByRole("button"); const radioButtons = screen.getAllByRole("radio"); - + // Initially standard mode - radioButtons.forEach(button => { - expect(button).toHaveClass("outline-[var(--color-border-default-tertiary)]"); + radioButtons.forEach((button) => { + expect(button).toHaveClass( + "outline-[var(--color-border-default-tertiary)]", + ); }); - + // Switch to inverse mode await user.click(toggleButton); - radioButtons.forEach(button => { - expect(button).toHaveClass("outline-[var(--color-border-inverse-primary)]"); + radioButtons.forEach((button) => { + expect(button).toHaveClass( + "outline-[var(--color-border-inverse-primary)]", + ); }); }); @@ -127,7 +135,7 @@ describe("RadioGroup Integration", () => { function StateForm() { const [value, setValue] = useState("option1"); const [count, setCount] = useState(0); - + return (
{ render(); const addButton = screen.getByRole("button"); - + // Initially 3 options expect(screen.getAllByRole("radio")).toHaveLength(3); - + // Add option await user.click(addButton); expect(screen.getAllByRole("radio")).toHaveLength(4); @@ -358,7 +370,7 @@ describe("RadioGroup Integration", () => { it("handles empty options gracefully", () => { function EmptyForm() { const [value, setValue] = useState(""); - + return ( { it("maintains single selection behavior", async () => { const user = userEvent.setup(); const handleChange = vi.fn(); - + function SingleSelectionForm() { const [value, setValue] = useState("option1"); - + return ( { render(); const radioButtons = screen.getAllByRole("radio"); - + // Initially option1 should be selected expect(radioButtons[0]).toHaveAttribute("aria-checked", "true"); expect(radioButtons[1]).toHaveAttribute("aria-checked", "false"); expect(radioButtons[2]).toHaveAttribute("aria-checked", "false"); - + // Click option2 const option2 = screen.getByText("Option 2").closest("label"); await user.click(option2); - + // Only option2 should be selected expect(radioButtons[0]).toHaveAttribute("aria-checked", "false"); expect(radioButtons[1]).toHaveAttribute("aria-checked", "true"); expect(radioButtons[2]).toHaveAttribute("aria-checked", "false"); - + expect(handleChange).toHaveBeenCalledWith("option2"); }); }); diff --git a/tests/integration/Select.integration.test.jsx b/tests/integration/Select.integration.test.jsx index 3bc904f..d4c2b12 100644 --- a/tests/integration/Select.integration.test.jsx +++ b/tests/integration/Select.integration.test.jsx @@ -71,7 +71,7 @@ describe("Select Component Integration", () => { await user.click(submitButton); expect(screen.getByTestId("error")).toHaveTextContent( - "Please select an option" + "Please select an option", ); }); @@ -298,17 +298,17 @@ describe("Select Component Integration", () => { name: /Dynamic Select/, }); expect(selectButton).not.toHaveClass( - "border-[var(--color-border-default-utility-negative)]" + "border-[var(--color-border-default-utility-negative)]", ); rerender(); expect(selectButton).toHaveClass( - "border-[var(--color-border-default-utility-negative)]" + "border-[var(--color-border-default-utility-negative)]", ); rerender(); expect(selectButton).not.toHaveClass( - "border-[var(--color-border-default-utility-negative)]" + "border-[var(--color-border-default-utility-negative)]", ); }); @@ -339,7 +339,7 @@ describe("Select Component Integration", () => { expect(selectButton).toHaveFocus(); // Should have focus state styling, not active state expect(selectButton).toHaveClass( - "focus-visible:border-[var(--color-border-default-utility-info)]" + "focus-visible:border-[var(--color-border-default-utility-info)]", ); }); @@ -354,7 +354,7 @@ describe("Select Component Integration", () => { // Click should not trigger focus-visible styles (class is always present but only active on keyboard focus) // The focus-visible class is always in the component but only applies on keyboard focus expect(selectButton).toHaveClass( - "focus-visible:border-[var(--color-border-default-utility-info)]" + "focus-visible:border-[var(--color-border-default-utility-info)]", ); }); }); @@ -392,7 +392,7 @@ describe("Select Component Integration", () => { label="Large Select" placeholder="Select an option" options={largeOptions} - /> + />, ); const selectButton = screen.getByRole("button", { name: /Large Select/ }); diff --git a/tests/integration/Switch.integration.test.jsx b/tests/integration/Switch.integration.test.jsx index d538e6b..5aca380 100644 --- a/tests/integration/Switch.integration.test.jsx +++ b/tests/integration/Switch.integration.test.jsx @@ -74,7 +74,7 @@ describe("Switch Integration", () => { -
+
, ); const switches = screen.getAllByRole("switch"); @@ -238,7 +238,7 @@ describe("Switch Integration", () => { await waitFor(() => { expect(switchButton).toHaveAttribute( "aria-checked", - i % 2 === 0 ? "true" : "false" + i % 2 === 0 ? "true" : "false", ); }); } @@ -251,7 +251,7 @@ describe("Switch Integration", () => { - + , ); const switches = screen.getAllByRole("switch"); diff --git a/tests/integration/TextArea.integration.test.jsx b/tests/integration/TextArea.integration.test.jsx index 2fbdd9a..c86505b 100644 --- a/tests/integration/TextArea.integration.test.jsx +++ b/tests/integration/TextArea.integration.test.jsx @@ -110,20 +110,20 @@ describe("TextArea Integration Tests", () => { const { rerender } = render(); let textarea = screen.getByRole("textbox"); expect(textarea).toHaveClass( - "border-[var(--color-border-default-tertiary)]" + "border-[var(--color-border-default-tertiary)]", ); rerender(); textarea = screen.getByRole("textbox"); expect(textarea).toHaveClass( - "shadow-[0_0_0_2px_var(--color-border-default-tertiary)]" + "shadow-[0_0_0_2px_var(--color-border-default-tertiary)]", ); rerender(); textarea = screen.getByRole("textbox"); expect(textarea).toHaveClass( "border-[var(--color-border-default-utility-info)]", - "shadow-[0_0_5px_3px_#3281F8]" + "shadow-[0_0_5px_3px_#3281F8]", ); }); @@ -141,13 +141,13 @@ describe("TextArea Integration Tests", () => { const { rerender } = render(); let textarea = screen.getByRole("textbox"); expect(textarea).toHaveClass( - "border-[var(--color-border-default-tertiary)]" + "border-[var(--color-border-default-tertiary)]", ); rerender(); textarea = screen.getByRole("textbox"); expect(textarea).toHaveClass( - "border-[var(--color-border-default-utility-negative)]" + "border-[var(--color-border-default-utility-negative)]", ); }); @@ -181,7 +181,7 @@ describe("TextArea Integration Tests", () => { label="Test TextArea" onFocus={handleFocus} onBlur={handleBlur} - /> + />, ); const textarea = screen.getByRole("textbox"); @@ -212,17 +212,17 @@ describe("TextArea Integration Tests", () => { label="Large TextArea" placeholder="Large placeholder" /> - + , ); expect( - screen.getByPlaceholderText("Small placeholder") + screen.getByPlaceholderText("Small placeholder"), ).toBeInTheDocument(); expect( - screen.getByPlaceholderText("Medium placeholder") + screen.getByPlaceholderText("Medium placeholder"), ).toBeInTheDocument(); expect( - screen.getByPlaceholderText("Large placeholder") + screen.getByPlaceholderText("Large placeholder"), ).toBeInTheDocument(); }); @@ -236,7 +236,7 @@ describe("TextArea Integration Tests", () => { placeholder="Disabled input" disabled /> - + , ); const validTextarea = screen.getByPlaceholderText("Valid input"); @@ -244,10 +244,10 @@ describe("TextArea Integration Tests", () => { const disabledTextarea = screen.getByPlaceholderText("Disabled input"); expect(validTextarea).toHaveClass( - "border-[var(--color-border-default-tertiary)]" + "border-[var(--color-border-default-tertiary)]", ); expect(invalidTextarea).toHaveClass( - "border-[var(--color-border-default-utility-negative)]" + "border-[var(--color-border-default-utility-negative)]", ); expect(disabledTextarea).toBeDisabled(); }); diff --git a/tests/integration/Toggle.integration.test.jsx b/tests/integration/Toggle.integration.test.jsx index a2474b8..90a2da5 100644 --- a/tests/integration/Toggle.integration.test.jsx +++ b/tests/integration/Toggle.integration.test.jsx @@ -12,7 +12,7 @@ describe("Toggle Integration", () => { - + , ); const toggle = screen.getByRole("switch", { name: "Test Toggle" }); @@ -32,7 +32,7 @@ describe("Toggle Integration", () => { - + , ); const firstToggle = screen.getByRole("switch", { name: "First Toggle" }); @@ -72,7 +72,7 @@ describe("Toggle Integration", () => {
-
+ , ); const firstToggle = screen.getByRole("switch", { name: "First Toggle" }); @@ -120,7 +120,7 @@ describe("Toggle Integration", () => { showText={true} icon="I" text="Toggle" - /> + />, ); toggle = screen.getByRole("switch"); expect(toggle).toHaveTextContent("I"); @@ -167,7 +167,7 @@ describe("Toggle Integration", () => { text="Toggle" /> - + , ); const iconToggle = screen.getByRole("switch", { name: "Icon Toggle" }); diff --git a/tests/integration/ToggleGroup.integration.test.jsx b/tests/integration/ToggleGroup.integration.test.jsx index 1802d3c..bc6324f 100644 --- a/tests/integration/ToggleGroup.integration.test.jsx +++ b/tests/integration/ToggleGroup.integration.test.jsx @@ -62,7 +62,7 @@ describe("ToggleGroup Integration", () => { - + , ); const submitButton = screen.getByRole("button", { name: "Submit" }); @@ -85,18 +85,22 @@ describe("ToggleGroup Integration", () => { it("handles dynamic prop changes", () => { const { rerender } = render( - + , ); let toggleGroup = screen.getByRole("button"); expect(toggleGroup).toHaveClass( "rounded-l-[var(--measures-radius-medium)]", - "rounded-r-none" + "rounded-r-none", ); expect(toggleGroup).toHaveTextContent("Dynamic Content"); rerender( - + , ); toggleGroup = screen.getByRole("button"); expect(toggleGroup).toHaveClass("rounded-none"); @@ -126,14 +130,14 @@ describe("ToggleGroup Integration", () => { fireEvent.click(toggleGroups[1]); await waitFor(() => { expect(toggleGroups[1]).toHaveClass( - "bg-[var(--color-magenta-magenta100)]" + "bg-[var(--color-magenta-magenta100)]", ); }); }); it("handles content changes", () => { const { rerender } = render( - Initial Content + Initial Content, ); let toggleGroup = screen.getByRole("button"); @@ -186,7 +190,7 @@ describe("ToggleGroup Integration", () => { fireEvent.click(toggleGroups[i % 3]); await waitFor(() => { expect(toggleGroups[i % 3]).toHaveClass( - "bg-[var(--color-magenta-magenta100)]" + "bg-[var(--color-magenta-magenta100)]", ); }); } @@ -204,7 +208,7 @@ describe("ToggleGroup Integration", () => { Text Only - + , ); const toggleGroups = screen.getAllByRole("button"); diff --git a/tests/storybook/Checkbox.storybook.test.js b/tests/storybook/Checkbox.storybook.test.js index b0e5322..bf86c0d 100644 --- a/tests/storybook/Checkbox.storybook.test.js +++ b/tests/storybook/Checkbox.storybook.test.js @@ -81,7 +81,7 @@ test.describe("Checkbox Storybook Tests", () => { await expect(page.locator('[data-testid="control-mode"]')).toBeVisible(); await expect(page.locator('[data-testid="control-state"]')).toBeVisible(); await expect( - page.locator('[data-testid="control-disabled"]') + page.locator('[data-testid="control-disabled"]'), ).toBeVisible(); await expect(page.locator('[data-testid="control-label"]')).toBeVisible(); }); diff --git a/tests/storybook/RadioButton.storybook.test.js b/tests/storybook/RadioButton.storybook.test.js index a792d8f..332c4b9 100644 --- a/tests/storybook/RadioButton.storybook.test.js +++ b/tests/storybook/RadioButton.storybook.test.js @@ -3,7 +3,7 @@ import { test, expect } from "@playwright/test"; test.describe("RadioButton Storybook Tests", () => { test.beforeEach(async ({ page }) => { await page.goto( - "http://localhost:6006/iframe.html?id=forms-radiobutton--default" + "http://localhost:6006/iframe.html?id=forms-radiobutton--default", ); }); @@ -15,7 +15,7 @@ test.describe("RadioButton Storybook Tests", () => { test("renders checked story", async ({ page }) => { await page.goto( - "http://localhost:6006/iframe.html?id=forms-radiobutton--checked" + "http://localhost:6006/iframe.html?id=forms-radiobutton--checked", ); const radioButton = page.locator('[role="radio"]'); @@ -25,7 +25,7 @@ test.describe("RadioButton Storybook Tests", () => { test("renders standard story", async ({ page }) => { await page.goto( - "http://localhost:6006/iframe.html?id=forms-radiobutton--standard" + "http://localhost:6006/iframe.html?id=forms-radiobutton--standard", ); const radioButtons = page.locator('[role="radio"]'); @@ -39,7 +39,7 @@ test.describe("RadioButton Storybook Tests", () => { test("renders inverse story", async ({ page }) => { await page.goto( - "http://localhost:6006/iframe.html?id=forms-radiobutton--inverse" + "http://localhost:6006/iframe.html?id=forms-radiobutton--inverse", ); const radioButtons = page.locator('[role="radio"]'); @@ -66,12 +66,12 @@ test.describe("RadioButton Storybook Tests", () => { await page.selectOption('[data-testid="mode-control"]', "inverse"); const radioButton = page.locator('[role="radio"]'); await expect(radioButton).toHaveClass( - /outline-\[var\(--color-border-inverse-primary\)\]/ + /outline-\[var\(--color-border-inverse-primary\)\]/, ); await page.selectOption('[data-testid="mode-control"]', "standard"); await expect(radioButton).toHaveClass( - /outline-\[var\(--color-border-default-tertiary\)\]/ + /outline-\[var\(--color-border-default-tertiary\)\]/, ); }); @@ -156,13 +156,13 @@ test.describe("RadioButton Storybook Tests", () => { await page.selectOption('[data-testid="mode-control"]', "standard"); const radioButton = page.locator('[role="radio"]'); await expect(radioButton).toHaveClass( - /outline-\[var\(--color-border-default-tertiary\)\]/ + /outline-\[var\(--color-border-default-tertiary\)\]/, ); // Test inverse mode await page.selectOption('[data-testid="mode-control"]', "inverse"); await expect(radioButton).toHaveClass( - /outline-\[var\(--color-border-inverse-primary\)\]/ + /outline-\[var\(--color-border-inverse-primary\)\]/, ); }); diff --git a/tests/storybook/RadioGroup.interactions.test.js b/tests/storybook/RadioGroup.interactions.test.js index 5efb013..280422c 100644 --- a/tests/storybook/RadioGroup.interactions.test.js +++ b/tests/storybook/RadioGroup.interactions.test.js @@ -173,7 +173,7 @@ export const FormIntegration = { // All should have the same name const names = await Promise.all( - hiddenInputs.map((input) => input.getAttribute("name")) + hiddenInputs.map((input) => input.getAttribute("name")), ); expect(names.every((name) => name === names[0])).toBe(true); diff --git a/tests/storybook/RadioGroup.storybook.test.js b/tests/storybook/RadioGroup.storybook.test.js index ff2a5e9..99c0873 100644 --- a/tests/storybook/RadioGroup.storybook.test.js +++ b/tests/storybook/RadioGroup.storybook.test.js @@ -3,7 +3,7 @@ import { test, expect } from "@playwright/test"; test.describe("RadioGroup Storybook Tests", () => { test.beforeEach(async ({ page }) => { await page.goto( - "http://localhost:6006/iframe.html?id=forms-radiogroup--default" + "http://localhost:6006/iframe.html?id=forms-radiogroup--default", ); }); @@ -17,7 +17,7 @@ test.describe("RadioGroup Storybook Tests", () => { test("renders standard story", async ({ page }) => { await page.goto( - "http://localhost:6006/iframe.html?id=forms-radiogroup--standard" + "http://localhost:6006/iframe.html?id=forms-radiogroup--standard", ); const radioGroup = page.locator('[role="radiogroup"]'); @@ -32,7 +32,7 @@ test.describe("RadioGroup Storybook Tests", () => { test("renders inverse story", async ({ page }) => { await page.goto( - "http://localhost:6006/iframe.html?id=forms-radiogroup--inverse" + "http://localhost:6006/iframe.html?id=forms-radiogroup--inverse", ); const radioGroup = page.locator('[role="radiogroup"]'); @@ -47,7 +47,7 @@ test.describe("RadioGroup Storybook Tests", () => { test("renders interactive story", async ({ page }) => { await page.goto( - "http://localhost:6006/iframe.html?id=forms-radiogroup--interactive" + "http://localhost:6006/iframe.html?id=forms-radiogroup--interactive", ); const radioGroup = page.locator('[role="radiogroup"]'); @@ -69,14 +69,14 @@ test.describe("RadioGroup Storybook Tests", () => { // All radio buttons should have inverse styling for (let i = 0; i < (await radioButtons.count()); i++) { await expect(radioButtons.nth(i)).toHaveClass( - /outline-\[var\(--color-border-inverse-primary\)\]/ + /outline-\[var\(--color-border-inverse-primary\)\]/, ); } await page.selectOption('[data-testid="mode-control"]', "standard"); for (let i = 0; i < (await radioButtons.count()); i++) { await expect(radioButtons.nth(i)).toHaveClass( - /outline-\[var\(--color-border-default-tertiary\)\]/ + /outline-\[var\(--color-border-default-tertiary\)\]/, ); } }); @@ -180,7 +180,7 @@ test.describe("RadioGroup Storybook Tests", () => { // All should have the same name const names = await hiddenInputs.evaluateAll((inputs) => - inputs.map((input) => input.getAttribute("name")) + inputs.map((input) => input.getAttribute("name")), ); expect(names.every((name) => name === names[0])).toBe(true); }); @@ -193,7 +193,7 @@ test.describe("RadioGroup Storybook Tests", () => { await expect(firstDot).toHaveClass( /w-\[16px\]/, /h-\[16px\]/, - /rounded-full/ + /rounded-full/, ); // Click second option @@ -204,13 +204,13 @@ test.describe("RadioGroup Storybook Tests", () => { await expect(secondDot).toHaveClass( /w-\[16px\]/, /h-\[16px\]/, - /rounded-full/ + /rounded-full/, ); }); test("handles interactive story state changes", async ({ page }) => { await page.goto( - "http://localhost:6006/iframe.html?id=forms-radiogroup--interactive" + "http://localhost:6006/iframe.html?id=forms-radiogroup--interactive", ); // Should show initial state diff --git a/tests/unit/ContextMenu.test.jsx b/tests/unit/ContextMenu.test.jsx index 1cc65a0..6b67d89 100644 --- a/tests/unit/ContextMenu.test.jsx +++ b/tests/unit/ContextMenu.test.jsx @@ -38,7 +38,7 @@ describe("ContextMenu Component", () => { "border", "rounded-[var(--measures-radius-medium)]", "shadow-lg", - "p-[4px]" + "p-[4px]", ); }); @@ -55,7 +55,7 @@ describe("ContextMenu Component", () => { const { container } = render( Menu Item - + , ); const results = await axe(container); expect(results).toHaveNoViolations(); @@ -93,7 +93,7 @@ describe("ContextMenuItem Component", () => { const item = screen.getByRole("menuitem"); expect(item).toHaveClass( "bg-[var(--color-surface-default-secondary)]", - "rounded-[var(--measures-radius-small)]" + "rounded-[var(--measures-radius-small)]", ); }); @@ -163,7 +163,7 @@ describe("ContextMenuItem Component", () => { const item = screen.getByRole("menuitem"); expect(item).toHaveClass( - "hover:!bg-[var(--color-surface-default-secondary)]" + "hover:!bg-[var(--color-surface-default-secondary)]", ); }); }); @@ -173,7 +173,7 @@ describe("ContextMenuItem Component", () => { const { container } = render( - + , ); const results = await axe(container); expect(results).toHaveNoViolations(); @@ -193,7 +193,7 @@ describe("ContextMenuItem Component", () => { const item = screen.getByRole("menuitem"); expect(item).toHaveClass( - "text-[var(--color-content-default-brand-primary)]" + "text-[var(--color-content-default-brand-primary)]", ); }); @@ -240,7 +240,7 @@ describe("ContextMenuSection Component", () => { const title = screen.getByText("Section Title"); expect(title).toHaveClass( "text-[var(--color-content-default-primary)]", - "font-medium" + "font-medium", ); }); }); @@ -270,7 +270,7 @@ describe("ContextMenuDivider Component", () => { expect(divider).toHaveClass( "border-t", "border-[var(--color-border-default-tertiary)]", - "my-1" + "my-1", ); }); }); diff --git a/tests/unit/Input.test.jsx b/tests/unit/Input.test.jsx index f52abf0..ce9d4ac 100644 --- a/tests/unit/Input.test.jsx +++ b/tests/unit/Input.test.jsx @@ -229,7 +229,7 @@ describe("Input Component", () => { expect(label).toHaveClass("text-[12px]"); expect(label).toHaveClass("leading-[14px]"); expect(label).toHaveClass("font-medium"); - expect(label).toHaveStyle("color: var(--color-content-default-secondary)"); + expect(label).toHaveClass("text-[var(--color-content-default-secondary)]"); }); test("applies correct input text styling for different sizes", () => { diff --git a/tests/unit/RadioButton.test.jsx b/tests/unit/RadioButton.test.jsx index 1362031..ad1f888 100644 --- a/tests/unit/RadioButton.test.jsx +++ b/tests/unit/RadioButton.test.jsx @@ -31,7 +31,11 @@ describe("RadioButton", () => { const handleChange = vi.fn(); render( - + , ); const radioButton = screen.getByRole("radio"); @@ -53,7 +57,7 @@ describe("RadioButton", () => { value="test-value" onChange={handleChange} label="Test Radio" - /> + />, ); const radioButton = screen.getByRole("radio"); @@ -70,7 +74,7 @@ describe("RadioButton", () => { const handleChange = vi.fn(); render( - + , ); const radioButton = screen.getByRole("radio"); @@ -85,7 +89,11 @@ describe("RadioButton", () => { const handleChange = vi.fn(); render( - + , ); const radioButton = screen.getByRole("radio"); @@ -103,7 +111,11 @@ describe("RadioButton", () => { const handleChange = vi.fn(); render( - + , ); const radioButton = screen.getByRole("radio"); @@ -121,7 +133,7 @@ describe("RadioButton", () => { const radioButton = screen.getByRole("radio"); expect(radioButton).toHaveClass( - "outline-[var(--color-border-default-tertiary)]" + "outline-[var(--color-border-default-tertiary)]", ); }); @@ -130,7 +142,7 @@ describe("RadioButton", () => { const radioButton = screen.getByRole("radio"); expect(radioButton).toHaveClass( - "outline-[var(--color-border-inverse-primary)]" + "outline-[var(--color-border-inverse-primary)]", ); }); @@ -155,7 +167,7 @@ describe("RadioButton", () => { value="test-value" checked={true} label="Test Radio" - /> + />, ); const hiddenInput = screen.getByDisplayValue("test-value"); @@ -209,7 +221,7 @@ describe("RadioButton", () => { it("shows dot indicator when checked", () => { render( - + , ); const dot = screen.getByRole("radio").querySelector("div"); @@ -218,7 +230,7 @@ describe("RadioButton", () => { it("hides dot indicator when unchecked", () => { render( - + , ); const dot = screen.getByRole("radio").querySelector("div"); @@ -230,7 +242,7 @@ describe("RadioButton", () => { expect( backgroundColor === "transparent" || backgroundColor === "rgba(0, 0, 0, 0)" || - backgroundColor === "" + backgroundColor === "", ).toBe(true); }); }); diff --git a/tests/unit/RadioGroup.test.jsx b/tests/unit/RadioGroup.test.jsx index 2d7540d..c64936f 100644 --- a/tests/unit/RadioGroup.test.jsx +++ b/tests/unit/RadioGroup.test.jsx @@ -47,7 +47,7 @@ describe("RadioGroup", () => { options={defaultOptions} value="option1" onChange={handleChange} - /> + />, ); const option2 = screen.getByText("Option 2").closest("label"); @@ -65,7 +65,7 @@ describe("RadioGroup", () => { options={defaultOptions} value="option1" onChange={handleChange} - /> + />, ); // Click option 3 @@ -84,7 +84,7 @@ describe("RadioGroup", () => { options={defaultOptions} value="option1" onChange={handleChange} - /> + />, ); const radioButtons = screen.getAllByRole("radio"); @@ -103,7 +103,7 @@ describe("RadioGroup", () => { options={defaultOptions} value="option1" onChange={handleChange} - /> + />, ); const radioButtons = screen.getAllByRole("radio"); @@ -119,7 +119,7 @@ describe("RadioGroup", () => { const radioButtons = screen.getAllByRole("radio"); radioButtons.forEach((button) => { expect(button).toHaveClass( - "outline-[var(--color-border-default-tertiary)]" + "outline-[var(--color-border-default-tertiary)]", ); }); }); @@ -130,7 +130,7 @@ describe("RadioGroup", () => { const radioButtons = screen.getAllByRole("radio"); radioButtons.forEach((button) => { expect(button).toHaveClass( - "outline-[var(--color-border-inverse-primary)]" + "outline-[var(--color-border-inverse-primary)]", ); }); }); @@ -174,7 +174,7 @@ describe("RadioGroup", () => { it("passes aria-label to radiogroup", () => { render( - + , ); const radioGroup = screen.getByRole("radiogroup"); @@ -206,7 +206,7 @@ describe("RadioGroup", () => { it("maintains selection state correctly", () => { const { rerender } = render( - + , ); let radioButtons = screen.getAllByRole("radio"); @@ -228,7 +228,7 @@ describe("RadioGroup", () => { options={defaultOptions} value="option2" onChange={handleChange} - /> + />, ); const option2 = screen.getByText("Option 2").closest("label"); diff --git a/tests/unit/Select.test.jsx b/tests/unit/Select.test.jsx index e96c3bd..aa764ee 100644 --- a/tests/unit/Select.test.jsx +++ b/tests/unit/Select.test.jsx @@ -28,7 +28,10 @@ describe("Select Component", () => { it("renders without label when not provided", () => { render( - , ); expect(screen.queryByText("Test Select")).not.toBeInTheDocument(); @@ -74,7 +77,7 @@ describe("Select Component", () => { it("applies correct height for small horizontal label", () => { render( - , ); const selectButton = screen.getByRole("button"); @@ -95,7 +98,7 @@ describe("Select Component", () => { const selectButton = screen.getByRole("button"); expect(selectButton).toHaveClass( - "border-[var(--color-border-default-tertiary)]" + "border-[var(--color-border-default-tertiary)]", ); }); @@ -104,7 +107,7 @@ describe("Select Component", () => { const selectButton = screen.getByRole("button"); expect(selectButton).toHaveClass( - "shadow-[0_0_0_2px_var(--color-border-default-tertiary)]" + "shadow-[0_0_0_2px_var(--color-border-default-tertiary)]", ); }); @@ -113,7 +116,7 @@ describe("Select Component", () => { const selectButton = screen.getByRole("button"); expect(selectButton).toHaveClass( - "border-[var(--color-border-default-utility-info)]" + "border-[var(--color-border-default-utility-info)]", ); expect(selectButton).toHaveClass("shadow-[0_0_5px_3px_#3281F8]"); }); @@ -123,7 +126,7 @@ describe("Select Component", () => { const selectButton = screen.getByRole("button"); expect(selectButton).toHaveClass( - "border-[var(--color-border-default-utility-negative)]" + "border-[var(--color-border-default-utility-negative)]", ); }); @@ -285,7 +288,7 @@ describe("Select Component", () => {