From c4a631a5d8b62515d47d6e28373bdb044d50a2a3 Mon Sep 17 00:00:00 2001
From: adilallo <39313955+adilallo@users.noreply.github.com>
Date: Tue, 14 Oct 2025 17:34:05 -0600
Subject: [PATCH] Cleanup code and tests
---
.storybook/fonts.css | 6 +-
app/components/Checkbox.js | 3 +-
app/components/ContextMenu.js | 2 +-
app/components/ContextMenuItem.js | 8 +-
app/components/ContextMenuSection.js | 2 +-
app/components/Input.js | 10 +-
app/components/RadioButton.js | 3 +-
app/components/RadioGroup.js | 3 +-
app/components/Select.js | 3 +-
app/components/Switch.js | 10 +-
app/components/TextArea.js | 10 +-
app/components/Toggle.js | 12 +-
app/components/ToggleGroup.js | 10 +-
app/tailwind.css | 13 +-
package-lock.json | 19 +++
package.json | 1 +
tests/accessibility/ContextMenu.a11y.test.jsx | 52 +++---
tests/accessibility/Input.a11y.test.jsx | 14 +-
tests/accessibility/Select.a11y.test.jsx | 4 +-
tests/accessibility/Toggle.a11y.test.jsx | 8 +-
tests/accessibility/ToggleGroup.a11y.test.jsx | 10 +-
.../accessibility/unit/Checkbox.a11y.test.jsx | 16 +-
.../unit/RadioButton.a11y.test.jsx | 18 ++-
.../unit/RadioGroup.a11y.test.jsx | 22 +--
tests/e2e/ContextMenu.storybook.test.ts | 22 +--
tests/e2e/Select.storybook.test.ts | 12 +-
.../ContextMenu.integration.test.jsx | 28 ++--
tests/integration/Input.integration.test.jsx | 22 +--
.../RadioButton.integration.test.jsx | 32 ++--
.../RadioGroup.integration.test.jsx | 150 ++++++++++--------
tests/integration/Select.integration.test.jsx | 14 +-
tests/integration/Switch.integration.test.jsx | 6 +-
.../integration/TextArea.integration.test.jsx | 26 +--
tests/integration/Toggle.integration.test.jsx | 10 +-
.../ToggleGroup.integration.test.jsx | 20 ++-
tests/storybook/Checkbox.storybook.test.js | 2 +-
tests/storybook/RadioButton.storybook.test.js | 16 +-
.../storybook/RadioGroup.interactions.test.js | 2 +-
tests/storybook/RadioGroup.storybook.test.js | 20 +--
tests/unit/ContextMenu.test.jsx | 16 +-
tests/unit/Input.test.jsx | 2 +-
tests/unit/RadioButton.test.jsx | 34 ++--
tests/unit/RadioGroup.test.jsx | 18 +--
tests/unit/Select.test.jsx | 19 ++-
tests/unit/Switch.test.jsx | 6 +-
tests/unit/TextArea.test.jsx | 12 +-
tests/unit/Toggle.test.jsx | 10 +-
tests/unit/ToggleGroup.test.jsx | 32 ++--
tests/visual/Checkbox.visual.test.js | 10 +-
vitest.config.mjs | 6 +-
50 files changed, 436 insertions(+), 370 deletions(-)
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 label = screen.getByText("Test Select");
- expect(label).toHaveClass("text-[var(--color-content-default-primary)]");
+ expect(label).toHaveClass(
+ "text-[var(--color-content-default-secondary)]"
+ );
});
});
diff --git a/tests/accessibility/Toggle.a11y.test.jsx b/tests/accessibility/Toggle.a11y.test.jsx
index 0fc7dfd..2b15824 100644
--- a/tests/accessibility/Toggle.a11y.test.jsx
+++ b/tests/accessibility/Toggle.a11y.test.jsx
@@ -56,7 +56,7 @@ describe("Toggle Accessibility", () => {
test("handles disabled state accessibility", () => {
const handleChange = vi.fn();
render(
-
+ ,
);
const toggle = screen.getByRole("switch");
@@ -88,7 +88,7 @@ describe("Toggle Accessibility", () => {
test("has no accessibility violations when disabled", async () => {
const { container } = render(
-
+ ,
);
const results = await axe(container);
expect(results).toHaveNoViolations();
@@ -96,7 +96,7 @@ describe("Toggle Accessibility", () => {
test("has no accessibility violations with icon", async () => {
const { container } = render(
-
+ ,
);
const results = await axe(container);
expect(results).toHaveNoViolations();
@@ -104,7 +104,7 @@ describe("Toggle Accessibility", () => {
test("has no accessibility violations with text", async () => {
const { container } = render(
-
+ ,
);
const results = await axe(container);
expect(results).toHaveNoViolations();
diff --git a/tests/accessibility/ToggleGroup.a11y.test.jsx b/tests/accessibility/ToggleGroup.a11y.test.jsx
index 387b1e3..8d7a9af 100644
--- a/tests/accessibility/ToggleGroup.a11y.test.jsx
+++ b/tests/accessibility/ToggleGroup.a11y.test.jsx
@@ -46,7 +46,7 @@ describe("ToggleGroup Accessibility", () => {
const toggleGroup = screen.getByRole("button");
expect(toggleGroup).toHaveClass("bg-[var(--color-magenta-magenta100)]");
expect(toggleGroup).toHaveClass(
- "shadow-[inset_0_0_0_1px_var(--color-border-default-secondary)]"
+ "shadow-[inset_0_0_0_1px_var(--color-border-default-secondary)]",
);
});
@@ -58,7 +58,7 @@ describe("ToggleGroup Accessibility", () => {
it("has no accessibility violations when focused", async () => {
const { container } = render(
- Focused Toggle
+ Focused Toggle,
);
const results = await axe(container);
expect(results).toHaveNoViolations();
@@ -66,7 +66,7 @@ describe("ToggleGroup Accessibility", () => {
it("has no accessibility violations when selected", async () => {
const { container } = render(
- Selected Toggle
+ Selected Toggle,
);
const results = await axe(container);
expect(results).toHaveNoViolations();
@@ -74,7 +74,7 @@ describe("ToggleGroup Accessibility", () => {
it("has no accessibility violations with text", async () => {
const { container } = render(
- Text Toggle
+ Text Toggle,
);
const results = await axe(container);
expect(results).toHaveNoViolations();
@@ -84,7 +84,7 @@ describe("ToggleGroup Accessibility", () => {
const { container } = render(
Icon Toggle
-
+ ,
);
const results = await axe(container);
expect(results).toHaveNoViolations();
diff --git a/tests/accessibility/unit/Checkbox.a11y.test.jsx b/tests/accessibility/unit/Checkbox.a11y.test.jsx
index f5508f7..8b8ed4d 100644
--- a/tests/accessibility/unit/Checkbox.a11y.test.jsx
+++ b/tests/accessibility/unit/Checkbox.a11y.test.jsx
@@ -15,7 +15,7 @@ describe("Checkbox Accessibility", () => {
test("should not have accessibility violations when checked", async () => {
const { container } = render(
-
+ ,
);
const results = await axe(container);
expect(results).toHaveNoViolations();
@@ -23,7 +23,7 @@ describe("Checkbox Accessibility", () => {
test("should not have accessibility violations when disabled", async () => {
const { container } = render(
-
+ ,
);
const results = await axe(container);
expect(results).toHaveNoViolations();
@@ -31,7 +31,7 @@ describe("Checkbox Accessibility", () => {
test("should not have accessibility violations in inverse mode", async () => {
const { container } = render(
-
+ ,
);
const results = await axe(container);
expect(results).toHaveNoViolations();
@@ -80,7 +80,7 @@ describe("Checkbox Accessibility", () => {
expect(checkbox).toHaveAttribute(
"aria-label",
- "Custom accessibility label"
+ "Custom accessibility label",
);
});
@@ -92,9 +92,7 @@ describe("Checkbox Accessibility", () => {
expect(checkbox).toHaveAttribute("tabIndex", "0");
// Should not be focusable when disabled
- rerender(
-
- );
+ rerender();
const disabledCheckbox = screen.getByRole("checkbox");
expect(disabledCheckbox).toHaveAttribute("tabIndex", "-1");
});
@@ -131,7 +129,7 @@ describe("Checkbox Accessibility", () => {
// Check for color contrast violations
const contrastViolations = results.violations.filter(
- (violation) => violation.id === "color-contrast"
+ (violation) => violation.id === "color-contrast",
);
expect(contrastViolations).toHaveLength(0);
});
@@ -142,7 +140,7 @@ describe("Checkbox Accessibility", () => {
// Check for focus indicator violations
const focusViolations = results.violations.filter(
- (violation) => violation.id === "focus-order-semantics"
+ (violation) => violation.id === "focus-order-semantics",
);
expect(focusViolations).toHaveLength(0);
});
diff --git a/tests/accessibility/unit/RadioButton.a11y.test.jsx b/tests/accessibility/unit/RadioButton.a11y.test.jsx
index 0acb0e0..f6d3039 100644
--- a/tests/accessibility/unit/RadioButton.a11y.test.jsx
+++ b/tests/accessibility/unit/RadioButton.a11y.test.jsx
@@ -16,7 +16,7 @@ describe("RadioButton Accessibility", () => {
it("updates aria-checked when checked state changes", () => {
const { rerender } = render(
-
+ ,
);
let radioButton = screen.getByRole("radio");
@@ -117,7 +117,7 @@ describe("RadioButton Accessibility", () => {
-
+ ,
);
const radioButtons = screen.getAllByRole("radio");
@@ -132,7 +132,7 @@ describe("RadioButton Accessibility", () => {
-
+ ,
);
const radioButtons = screen.getAllByRole("radio");
@@ -176,7 +176,7 @@ describe("RadioButton Accessibility", () => {
checked={false}
onChange={handleChange}
label="Focus Radio"
- />
+ />,
);
const radioButton = screen.getByRole("radio");
@@ -185,7 +185,11 @@ describe("RadioButton Accessibility", () => {
// Change checked state
rerender(
-
+ ,
);
// Should still be focusable
@@ -206,7 +210,7 @@ describe("RadioButton Accessibility", () => {
-
+ ,
);
const radioButtons = screen.getAllByRole("radio");
@@ -220,7 +224,7 @@ describe("RadioButton Accessibility", () => {
it("has proper form association", () => {
render(
-
+ ,
);
const hiddenInput = screen.getByDisplayValue("test-value");
diff --git a/tests/accessibility/unit/RadioGroup.a11y.test.jsx b/tests/accessibility/unit/RadioGroup.a11y.test.jsx
index 9a166fa..192245e 100644
--- a/tests/accessibility/unit/RadioGroup.a11y.test.jsx
+++ b/tests/accessibility/unit/RadioGroup.a11y.test.jsx
@@ -20,7 +20,7 @@ describe("RadioGroup Accessibility", () => {
it("has proper ARIA attributes on radiogroup", () => {
render(
-
+ ,
);
const radioGroup = screen.getByRole("radiogroup");
@@ -50,7 +50,7 @@ describe("RadioGroup Accessibility", () => {
it("updates selection state correctly", () => {
const { rerender } = render(
-
+ ,
);
let radioButtons = screen.getAllByRole("radio");
@@ -98,7 +98,7 @@ describe("RadioGroup Accessibility", () => {
options={defaultOptions}
value="option1"
onChange={handleChange}
- />
+ />,
);
const radioButtons = screen.getAllByRole("radio");
@@ -125,7 +125,7 @@ describe("RadioGroup Accessibility", () => {
options={defaultOptions}
value="option1"
onChange={handleChange}
- />
+ />,
);
const radioButtons = screen.getAllByRole("radio");
@@ -144,7 +144,7 @@ describe("RadioGroup Accessibility", () => {
options={defaultOptions}
value="option1"
onChange={handleChange}
- />
+ />,
);
const radioButtons = screen.getAllByRole("radio");
@@ -163,7 +163,7 @@ describe("RadioGroup Accessibility", () => {
options={defaultOptions}
value="option1"
onChange={handleChange}
- />
+ />,
);
const radioButtons = screen.getAllByRole("radio");
@@ -190,7 +190,7 @@ describe("RadioGroup Accessibility", () => {
-
+ ,
);
const radioButtons = screen.getAllByRole("radio");
@@ -212,7 +212,7 @@ describe("RadioGroup Accessibility", () => {
it("has proper form association", () => {
render(
-
+ ,
);
const hiddenInputs = screen.getAllByDisplayValue("option1");
@@ -235,7 +235,7 @@ describe("RadioGroup Accessibility", () => {
options={defaultOptions}
value="option1"
onChange={handleChange}
- />
+ />,
);
const radioButtons = screen.getAllByRole("radio");
@@ -248,7 +248,7 @@ describe("RadioGroup Accessibility", () => {
options={defaultOptions}
value="option2"
onChange={handleChange}
- />
+ />,
);
// Should still be focusable
@@ -301,7 +301,7 @@ describe("RadioGroup Accessibility", () => {
options={defaultOptions}
value="option1"
onChange={handleChange}
- />
+ />,
);
const radioButtons = screen.getAllByRole("radio");
diff --git a/tests/e2e/ContextMenu.storybook.test.ts b/tests/e2e/ContextMenu.storybook.test.ts
index 1e1b18b..85d20e6 100644
--- a/tests/e2e/ContextMenu.storybook.test.ts
+++ b/tests/e2e/ContextMenu.storybook.test.ts
@@ -3,7 +3,7 @@ import { test, expect } from "@playwright/test";
test.describe("ContextMenu Components Storybook Tests", () => {
test.beforeEach(async ({ page }) => {
await page.goto(
- "http://localhost:6006/?path=/story/forms-contextmenu--default"
+ "http://localhost:6006/?path=/story/forms-contextmenu--default",
);
});
@@ -38,7 +38,7 @@ test.describe("ContextMenu Components Storybook Tests", () => {
test("shows selected state correctly", async ({ page }) => {
// Navigate to MenuItem story
await page.goto(
- "http://localhost:6006/?path=/story/forms-contextmenu--menu-item"
+ "http://localhost:6006/?path=/story/forms-contextmenu--menu-item",
);
const menuItems = page.getByRole("option");
@@ -60,7 +60,7 @@ test.describe("ContextMenu Components Storybook Tests", () => {
test("shows submenu indicators", async ({ page }) => {
// Navigate to MenuItem story
await page.goto(
- "http://localhost:6006/?path=/story/forms-contextmenu--menu-item"
+ "http://localhost:6006/?path=/story/forms-contextmenu--menu-item",
);
const submenuArrows = page.getByTestId("submenu-arrow");
@@ -74,7 +74,7 @@ test.describe("ContextMenu Components Storybook Tests", () => {
test("shows checkmarks for selected items", async ({ page }) => {
// Navigate to MenuItem story
await page.goto(
- "http://localhost:6006/?path=/story/forms-contextmenu--menu-item"
+ "http://localhost:6006/?path=/story/forms-contextmenu--menu-item",
);
const checkmarks = page.getByTestId("checkmark");
@@ -88,7 +88,7 @@ test.describe("ContextMenu Components Storybook Tests", () => {
test("renders menu sections correctly", async ({ page }) => {
// Navigate to MenuSection story
await page.goto(
- "http://localhost:6006/?path=/story/forms-contextmenu--menu-section"
+ "http://localhost:6006/?path=/story/forms-contextmenu--menu-section",
);
const sectionTitles = page.getByText(/Section/);
@@ -104,7 +104,7 @@ test.describe("ContextMenu Components Storybook Tests", () => {
test("renders menu dividers correctly", async ({ page }) => {
// Navigate to MenuDivider story
await page.goto(
- "http://localhost:6006/?path=/story/forms-contextmenu--menu-divider"
+ "http://localhost:6006/?path=/story/forms-contextmenu--menu-divider",
);
const dividers = page.getByTestId("context-menu-divider");
@@ -120,7 +120,7 @@ test.describe("ContextMenu Components Storybook Tests", () => {
test("shows all variants correctly", async ({ page }) => {
// Navigate to All Variants story
await page.goto(
- "http://localhost:6006/?path=/story/forms-contextmenu--all-variants"
+ "http://localhost:6006/?path=/story/forms-contextmenu--all-variants",
);
const menu = page.getByRole("listbox");
@@ -195,7 +195,7 @@ test.describe("ContextMenu Components Storybook Tests", () => {
test("has correct styling for different sizes", async ({ page }) => {
// Navigate to All Variants story
await page.goto(
- "http://localhost:6006/?path=/story/forms-contextmenu--all-variants"
+ "http://localhost:6006/?path=/story/forms-contextmenu--all-variants",
);
const menuItems = page.getByRole("option");
@@ -232,7 +232,7 @@ test.describe("ContextMenu Components Storybook Tests", () => {
test("handles disabled items correctly", async ({ page }) => {
// Navigate to All Variants story
await page.goto(
- "http://localhost:6006/?path=/story/forms-contextmenu--all-variants"
+ "http://localhost:6006/?path=/story/forms-contextmenu--all-variants",
);
const menuItems = page.getByRole("option");
@@ -268,7 +268,7 @@ test.describe("ContextMenu Components Storybook Tests", () => {
test("renders with custom styling", async ({ page }) => {
// Navigate to With Custom Styling story
await page.goto(
- "http://localhost:6006/?path=/story/forms-contextmenu--with-custom-styling"
+ "http://localhost:6006/?path=/story/forms-contextmenu--with-custom-styling",
);
const menu = page.getByRole("listbox");
@@ -282,7 +282,7 @@ test.describe("ContextMenu Components Storybook Tests", () => {
test("handles interactive story correctly", async ({ page }) => {
// Navigate to Interactive story
await page.goto(
- "http://localhost:6006/?path=/story/forms-contextmenu--interactive"
+ "http://localhost:6006/?path=/story/forms-contextmenu--interactive",
);
const menuItems = page.getByRole("option");
diff --git a/tests/e2e/Select.storybook.test.ts b/tests/e2e/Select.storybook.test.ts
index 36b4134..b2d25ee 100644
--- a/tests/e2e/Select.storybook.test.ts
+++ b/tests/e2e/Select.storybook.test.ts
@@ -71,7 +71,7 @@ test.describe("Select Component Storybook Tests", () => {
test("shows different sizes correctly", async ({ page }) => {
// Navigate to All Sizes story
await page.goto(
- "http://localhost:6006/?path=/story/forms-select--all-sizes"
+ "http://localhost:6006/?path=/story/forms-select--all-sizes",
);
const selectButtons = page.getByRole("button");
@@ -89,7 +89,7 @@ test.describe("Select Component Storybook Tests", () => {
test("shows different states correctly", async ({ page }) => {
// Navigate to All States story
await page.goto(
- "http://localhost:6006/?path=/story/forms-select--all-states"
+ "http://localhost:6006/?path=/story/forms-select--all-states",
);
const selectButtons = page.getByRole("button");
@@ -160,7 +160,7 @@ test.describe("Select Component Storybook Tests", () => {
test("disabled state prevents interaction", async ({ page }) => {
// Navigate to Disabled story
await page.goto(
- "http://localhost:6006/?path=/story/forms-select--disabled"
+ "http://localhost:6006/?path=/story/forms-select--disabled",
);
const selectButton = page.getByRole("button");
@@ -177,7 +177,7 @@ test.describe("Select Component Storybook Tests", () => {
test("interactive story allows selection", async ({ page }) => {
// Navigate to Interactive story
await page.goto(
- "http://localhost:6006/?path=/story/forms-select--interactive"
+ "http://localhost:6006/?path=/story/forms-select--interactive",
);
const selectButton = page.getByRole("button");
@@ -195,7 +195,7 @@ test.describe("Select Component Storybook Tests", () => {
test("horizontal label variant displays correctly", async ({ page }) => {
// Navigate to Horizontal Label story
await page.goto(
- "http://localhost:6006/?path=/story/forms-select--horizontal-label"
+ "http://localhost:6006/?path=/story/forms-select--horizontal-label",
);
const selectButton = page.getByRole("button");
@@ -259,7 +259,7 @@ test.describe("Select Component Storybook Tests", () => {
test("focus behavior works correctly", async ({ page }) => {
// Navigate to Interactive story
await page.goto(
- "http://localhost:6006/?path=/story/forms-select--interactive"
+ "http://localhost:6006/?path=/story/forms-select--interactive",
);
const selectButton = page.getByRole("button");
diff --git a/tests/integration/ContextMenu.integration.test.jsx b/tests/integration/ContextMenu.integration.test.jsx
index 9296cf4..569745a 100644
--- a/tests/integration/ContextMenu.integration.test.jsx
+++ b/tests/integration/ContextMenu.integration.test.jsx
@@ -59,7 +59,7 @@ describe("ContextMenu Components Integration", () => {
const action1 = screen.getByRole("menuitem", { name: "Action 1" });
expect(action1).toHaveClass(
- "bg-[var(--color-surface-default-secondary)]"
+ "bg-[var(--color-surface-default-secondary)]",
);
});
@@ -97,10 +97,10 @@ describe("ContextMenu Components Integration", () => {
const enabledItems = items.filter(
(item) =>
!item.hasAttribute("aria-disabled") ||
- item.getAttribute("aria-disabled") !== "true"
+ item.getAttribute("aria-disabled") !== "true",
);
const disabledItems = items.filter(
- (item) => item.getAttribute("aria-disabled") === "true"
+ (item) => item.getAttribute("aria-disabled") === "true",
);
enabledItems.forEach((item) => {
@@ -177,7 +177,7 @@ describe("ContextMenu Components Integration", () => {
]}
selectedValue=""
onItemClick={onItemClick}
- />
+ />,
);
const item1 = screen.getByText("Item 1");
@@ -194,12 +194,12 @@ describe("ContextMenu Components Integration", () => {
]}
selectedValue="1"
onItemClick={onItemClick}
- />
+ />,
);
expect(screen.getByText("Item 3")).toBeInTheDocument();
expect(screen.getByRole("menuitem", { name: "Item 1" })).toHaveClass(
- "bg-[var(--color-surface-default-secondary)]"
+ "bg-[var(--color-surface-default-secondary)]",
);
});
@@ -213,7 +213,7 @@ describe("ContextMenu Components Integration", () => {
]}
selectedValue="2"
onItemClick={vi.fn()}
- />
+ />,
);
expect(screen.getByText("Item 2")).toBeInTheDocument();
@@ -226,7 +226,7 @@ describe("ContextMenu Components Integration", () => {
]}
selectedValue=""
onItemClick={vi.fn()}
- />
+ />,
);
expect(screen.queryByText("Item 2")).not.toBeInTheDocument();
@@ -278,7 +278,7 @@ describe("ContextMenu Components Integration", () => {
expect(screen.getByText("Option 1")).toBeInTheDocument();
expect(
- screen.getByRole("button", { name: "Close Menu" })
+ screen.getByRole("button", { name: "Close Menu" }),
).toBeInTheDocument();
});
@@ -294,7 +294,7 @@ describe("ContextMenu Components Integration", () => {
expect(screen.queryByText("Option 1")).not.toBeInTheDocument();
expect(
- screen.getByRole("button", { name: "Open Menu" })
+ screen.getByRole("button", { name: "Open Menu" }),
).toBeInTheDocument();
});
});
@@ -338,7 +338,7 @@ describe("ContextMenu Components Integration", () => {
Item 2
-
+ ,
);
// Rapidly change selection state
@@ -351,7 +351,7 @@ describe("ContextMenu Components Integration", () => {
Item 2
-
+ ,
);
}
@@ -366,7 +366,7 @@ describe("ContextMenu Components Integration", () => {
render(
Item without onClick
-
+ ,
);
const item = screen.getByText("Item without onClick");
@@ -379,7 +379,7 @@ describe("ContextMenu Components Integration", () => {
Item with invalid selected
-
+ ,
);
const item = screen.getByText("Item with invalid selected");
diff --git a/tests/integration/Input.integration.test.jsx b/tests/integration/Input.integration.test.jsx
index 790960b..971d997 100644
--- a/tests/integration/Input.integration.test.jsx
+++ b/tests/integration/Input.integration.test.jsx
@@ -160,7 +160,7 @@ describe("Input Component Integration", () => {
fireEvent.change(input, { target: { value: "ab" } });
expect(screen.getByTestId("error-message")).toBeInTheDocument();
expect(input).toHaveClass(
- "border-[var(--color-border-default-utility-negative)]"
+ "border-[var(--color-border-default-utility-negative)]",
);
// Type longer value - should hide error
@@ -175,7 +175,7 @@ describe("Input Component Integration", () => {
-
+ ,
);
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 (
,
);
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", () => {
+ ,
);
const selectButton = screen.getByRole("button");
@@ -381,7 +384,7 @@ describe("Select Component", () => {
expect(selectButton).toHaveFocus();
expect(selectButton).toHaveClass(
- "focus-visible:border-[var(--color-border-default-utility-info)]"
+ "focus-visible:border-[var(--color-border-default-utility-info)]",
);
});
diff --git a/tests/unit/Switch.test.jsx b/tests/unit/Switch.test.jsx
index 3fbd348..3e4fa40 100644
--- a/tests/unit/Switch.test.jsx
+++ b/tests/unit/Switch.test.jsx
@@ -19,7 +19,7 @@ describe("Switch Component", () => {
onChange={handleChange}
label="Test Switch"
state="focus"
- />
+ />,
);
const switchButton = screen.getByRole("switch");
@@ -140,7 +140,7 @@ describe("Switch Component", () => {
"transition-all",
"duration-200",
"focus:outline-none",
- "focus-visible:shadow-[0_0_5px_3px_#3281F8]"
+ "focus-visible:shadow-[0_0_5px_3px_#3281F8]",
);
});
@@ -178,7 +178,7 @@ describe("Switch Component", () => {
"font-normal",
"text-[14px]",
"leading-[20px]",
- "text-[var(--color-content-default-primary)]"
+ "text-[var(--color-content-default-primary)]",
);
});
});
diff --git a/tests/unit/TextArea.test.jsx b/tests/unit/TextArea.test.jsx
index 49bf6e7..105e44e 100644
--- a/tests/unit/TextArea.test.jsx
+++ b/tests/unit/TextArea.test.jsx
@@ -63,7 +63,7 @@ describe("TextArea", () => {
render();
const textarea = screen.getByRole("textbox");
expect(textarea).toHaveClass(
- "border-[var(--color-border-default-utility-negative)]"
+ "border-[var(--color-border-default-utility-negative)]",
);
});
@@ -71,20 +71,20 @@ describe("TextArea", () => {
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]",
);
});
@@ -151,7 +151,7 @@ describe("TextArea", () => {
size="small"
labelVariant="horizontal"
label="Small Horizontal"
- />
+ />,
);
const textarea = screen.getByRole("textbox");
expect(textarea).toHaveClass("h-[60px]");
@@ -163,7 +163,7 @@ describe("TextArea", () => {
size="medium"
labelVariant="horizontal"
label="Medium Horizontal"
- />
+ />,
);
const textarea = screen.getByRole("textbox");
expect(textarea).toHaveClass("h-[110px]");
diff --git a/tests/unit/Toggle.test.jsx b/tests/unit/Toggle.test.jsx
index 40b55af..72421b2 100644
--- a/tests/unit/Toggle.test.jsx
+++ b/tests/unit/Toggle.test.jsx
@@ -21,7 +21,7 @@ describe("Toggle Component", () => {
checked={true}
disabled={true}
className="custom-class"
- />
+ />,
);
const toggle = screen.getByRole("switch");
@@ -82,7 +82,7 @@ describe("Toggle Component", () => {
showText={true}
icon="I"
text="Toggle"
- />
+ />,
);
const toggle = screen.getByRole("switch");
@@ -103,7 +103,7 @@ describe("Toggle Component", () => {
test("does not call onChange when disabled", () => {
const handleChange = vi.fn();
render(
-
+ ,
);
const toggle = screen.getByRole("switch");
@@ -132,7 +132,7 @@ describe("Toggle Component", () => {
const toggle = screen.getByRole("switch");
expect(toggle).toHaveClass(
- "hover:!bg-[var(--color-surface-default-secondary)]"
+ "hover:!bg-[var(--color-surface-default-secondary)]",
);
});
@@ -141,7 +141,7 @@ describe("Toggle Component", () => {
const toggle = screen.getByRole("switch");
expect(toggle).not.toHaveClass(
- "hover:!bg-[var(--color-surface-default-secondary)]"
+ "hover:!bg-[var(--color-surface-default-secondary)]",
);
});
diff --git a/tests/unit/ToggleGroup.test.jsx b/tests/unit/ToggleGroup.test.jsx
index a284398..359f2a4 100644
--- a/tests/unit/ToggleGroup.test.jsx
+++ b/tests/unit/ToggleGroup.test.jsx
@@ -15,7 +15,7 @@ describe("ToggleGroup Component", () => {
render(
Custom Content
-
+ ,
);
const toggleGroup = screen.getByRole("button");
expect(toggleGroup).toBeInTheDocument();
@@ -24,12 +24,12 @@ describe("ToggleGroup Component", () => {
it("handles position prop correctly", () => {
const { rerender } = render(
- Left
+ Left,
);
let toggleGroup = screen.getByRole("button");
expect(toggleGroup).toHaveClass(
"rounded-l-[var(--measures-radius-medium)]",
- "rounded-r-none"
+ "rounded-r-none",
);
rerender(Middle);
@@ -40,17 +40,17 @@ describe("ToggleGroup Component", () => {
toggleGroup = screen.getByRole("button");
expect(toggleGroup).toHaveClass(
"rounded-r-[var(--measures-radius-medium)]",
- "rounded-l-none"
+ "rounded-l-none",
);
});
it("handles state prop correctly", () => {
const { rerender } = render(
- Default
+ Default,
);
let toggleGroup = screen.getByRole("button");
expect(toggleGroup).toHaveClass(
- "bg-[var(--color-surface-default-primary)]"
+ "bg-[var(--color-surface-default-primary)]",
);
rerender(Hover);
@@ -61,20 +61,20 @@ describe("ToggleGroup Component", () => {
toggleGroup = screen.getByRole("button");
expect(toggleGroup).toHaveClass(
"bg-[var(--color-surface-default-primary)]",
- "shadow-[0_0_5px_1px_#3281F8]"
+ "shadow-[0_0_5px_1px_#3281F8]",
);
rerender(Selected);
toggleGroup = screen.getByRole("button");
expect(toggleGroup).toHaveClass(
"bg-[var(--color-magenta-magenta100)]",
- "shadow-[inset_0_0_0_1px_var(--color-border-default-secondary)]"
+ "shadow-[inset_0_0_0_1px_var(--color-border-default-secondary)]",
);
});
it("handles showText prop correctly", () => {
const { rerender } = render(
- Visible Text
+ Visible Text,
);
let toggleGroup = screen.getByRole("button");
expect(toggleGroup).toHaveTextContent("Visible Text");
@@ -131,11 +131,11 @@ describe("ToggleGroup Component", () => {
it("applies correct classes for different states", () => {
const { rerender } = render(
- Default
+ Default,
);
let toggleGroup = screen.getByRole("button");
expect(toggleGroup).toHaveClass(
- "bg-[var(--color-surface-default-primary)]"
+ "bg-[var(--color-surface-default-primary)]",
);
rerender(Hover);
@@ -150,18 +150,18 @@ describe("ToggleGroup Component", () => {
toggleGroup = screen.getByRole("button");
expect(toggleGroup).toHaveClass(
"bg-[var(--color-magenta-magenta100)]",
- "shadow-[inset_0_0_0_1px_var(--color-border-default-secondary)]"
+ "shadow-[inset_0_0_0_1px_var(--color-border-default-secondary)]",
);
});
it("applies correct position classes", () => {
const { rerender } = render(
- Left
+ Left,
);
let toggleGroup = screen.getByRole("button");
expect(toggleGroup).toHaveClass(
"rounded-l-[var(--measures-radius-medium)]",
- "rounded-r-none"
+ "rounded-r-none",
);
rerender(Middle);
@@ -172,7 +172,7 @@ describe("ToggleGroup Component", () => {
toggleGroup = screen.getByRole("button");
expect(toggleGroup).toHaveClass(
"rounded-r-[var(--measures-radius-medium)]",
- "rounded-l-none"
+ "rounded-l-none",
);
});
@@ -195,7 +195,7 @@ describe("ToggleGroup Component", () => {
"hover:bg-[var(--color-magenta-magenta100)]",
"flex",
"items-center",
- "justify-center"
+ "justify-center",
);
});
diff --git a/tests/visual/Checkbox.visual.test.js b/tests/visual/Checkbox.visual.test.js
index 6ccfe26..b2a02ae 100644
--- a/tests/visual/Checkbox.visual.test.js
+++ b/tests/visual/Checkbox.visual.test.js
@@ -4,7 +4,7 @@ test.describe("Checkbox Visual Regression Tests", () => {
test("Standard mode - unchecked", async ({ page }) => {
await page.goto("/forms");
await expect(
- page.locator('[data-testid="standard-unchecked"]')
+ page.locator('[data-testid="standard-unchecked"]'),
).toBeVisible();
await expect(page).toHaveScreenshot("checkbox-standard-unchecked.png");
});
@@ -12,7 +12,7 @@ test.describe("Checkbox Visual Regression Tests", () => {
test("Standard mode - checked", async ({ page }) => {
await page.goto("/forms");
await expect(
- page.locator('[data-testid="standard-checked"]')
+ page.locator('[data-testid="standard-checked"]'),
).toBeVisible();
await expect(page).toHaveScreenshot("checkbox-standard-checked.png");
});
@@ -20,7 +20,7 @@ test.describe("Checkbox Visual Regression Tests", () => {
test("Inverse mode - unchecked", async ({ page }) => {
await page.goto("/forms");
await expect(
- page.locator('[data-testid="inverse-unchecked"]')
+ page.locator('[data-testid="inverse-unchecked"]'),
).toBeVisible();
await expect(page).toHaveScreenshot("checkbox-inverse-unchecked.png");
});
@@ -62,7 +62,7 @@ test.describe("Checkbox Visual Regression Tests", () => {
test("Disabled state - standard", async ({ page }) => {
await page.goto("/forms");
await expect(
- page.locator('[data-testid="standard-disabled"]')
+ page.locator('[data-testid="standard-disabled"]'),
).toBeVisible();
await expect(page).toHaveScreenshot("checkbox-standard-disabled.png");
});
@@ -70,7 +70,7 @@ test.describe("Checkbox Visual Regression Tests", () => {
test("Disabled state - inverse", async ({ page }) => {
await page.goto("/forms");
await expect(
- page.locator('[data-testid="inverse-disabled"]')
+ page.locator('[data-testid="inverse-disabled"]'),
).toBeVisible();
await expect(page).toHaveScreenshot("checkbox-inverse-disabled.png");
});
diff --git a/vitest.config.mjs b/vitest.config.mjs
index 7f05f20..f280a6b 100644
--- a/vitest.config.mjs
+++ b/vitest.config.mjs
@@ -16,7 +16,11 @@ export default defineConfig({
"tests/unit/**/*.test.{js,jsx,ts,tsx}",
"tests/integration/**/*.test.{js,jsx,ts,tsx}",
"tests/accessibility/**/*.test.{js,jsx,ts,tsx}",
- "tests/e2e/**/*.test.{js,jsx,ts,tsx}",
+ "tests/e2e/**/*.e2e.test.{js,jsx,ts,tsx}",
+ ],
+ exclude: [
+ "tests/e2e/**/*.storybook.test.{js,jsx,ts,tsx}",
+ "tests/e2e/**/*.spec.{js,jsx,ts,tsx}",
],
css: true,
coverage: {