Cleanup code and tests
CI Pipeline / test (20) (pull_request) Successful in 2m55s
CI Pipeline / test (18) (pull_request) Successful in 3m32s
CI Pipeline / e2e (webkit) (pull_request) Has been cancelled
CI Pipeline / visual-regression (pull_request) Has been cancelled
CI Pipeline / performance (pull_request) Has been cancelled
CI Pipeline / storybook (pull_request) Has been cancelled
CI Pipeline / lint (pull_request) Has been cancelled
CI Pipeline / build (pull_request) Has been cancelled
CI Pipeline / e2e (chromium) (pull_request) Has been cancelled
CI Pipeline / e2e (firefox) (pull_request) Has been cancelled

This commit is contained in:
adilallo
2025-10-14 17:34:05 -06:00
parent 9de194bfc0
commit c4a631a5d8
50 changed files with 436 additions and 370 deletions
@@ -15,7 +15,7 @@ describe("Checkbox Accessibility", () => {
test("should not have accessibility violations when checked", async () => {
const { container } = render(
<Checkbox label="Test checkbox" checked={true} />
<Checkbox label="Test checkbox" checked={true} />,
);
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(
<Checkbox label="Test checkbox" disabled={true} />
<Checkbox label="Test checkbox" disabled={true} />,
);
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(
<Checkbox label="Test checkbox" mode="inverse" />
<Checkbox label="Test checkbox" mode="inverse" />,
);
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(
<Checkbox label="Test checkbox disabled" disabled={true} />
);
rerender(<Checkbox label="Test checkbox disabled" disabled={true} />);
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);
});
@@ -16,7 +16,7 @@ describe("RadioButton Accessibility", () => {
it("updates aria-checked when checked state changes", () => {
const { rerender } = render(
<RadioButton checked={false} label="Test Radio" />
<RadioButton checked={false} label="Test Radio" />,
);
let radioButton = screen.getByRole("radio");
@@ -117,7 +117,7 @@ describe("RadioButton Accessibility", () => {
<RadioButton label="First Radio" />
<RadioButton label="Second Radio" />
<RadioButton label="Third Radio" />
</div>
</div>,
);
const radioButtons = screen.getAllByRole("radio");
@@ -132,7 +132,7 @@ describe("RadioButton Accessibility", () => {
<RadioButton label="Radio 1" />
<RadioButton label="Radio 2" />
<RadioButton label="Radio 3" />
</div>
</div>,
);
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(
<RadioButton checked={true} onChange={handleChange} label="Focus Radio" />
<RadioButton
checked={true}
onChange={handleChange}
label="Focus Radio"
/>,
);
// Should still be focusable
@@ -206,7 +210,7 @@ describe("RadioButton Accessibility", () => {
<RadioButton label="First Option" />
<RadioButton label="Second Option" />
<RadioButton label="Third Option" />
</div>
</div>,
);
const radioButtons = screen.getAllByRole("radio");
@@ -220,7 +224,7 @@ describe("RadioButton Accessibility", () => {
it("has proper form association", () => {
render(
<RadioButton name="test-radio" value="test-value" label="Form Radio" />
<RadioButton name="test-radio" value="test-value" label="Form Radio" />,
);
const hiddenInput = screen.getByDisplayValue("test-value");
@@ -20,7 +20,7 @@ describe("RadioGroup Accessibility", () => {
it("has proper ARIA attributes on radiogroup", () => {
render(
<RadioGroup options={defaultOptions} aria-label="Test Radio Group" />
<RadioGroup options={defaultOptions} aria-label="Test Radio Group" />,
);
const radioGroup = screen.getByRole("radiogroup");
@@ -50,7 +50,7 @@ describe("RadioGroup Accessibility", () => {
it("updates selection state correctly", () => {
const { rerender } = render(
<RadioGroup options={defaultOptions} value="option1" />
<RadioGroup options={defaultOptions} value="option1" />,
);
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", () => {
<div>
<RadioGroup options={defaultOptions} />
<RadioGroup options={defaultOptions} />
</div>
</div>,
);
const radioButtons = screen.getAllByRole("radio");
@@ -212,7 +212,7 @@ describe("RadioGroup Accessibility", () => {
it("has proper form association", () => {
render(
<RadioGroup options={defaultOptions} name="test-group" value="option2" />
<RadioGroup options={defaultOptions} name="test-group" value="option2" />,
);
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");