Fix ESLint errors

This commit is contained in:
adilallo
2026-01-28 11:38:38 -07:00
parent 2e027f5bb2
commit 6b8d646f8a
82 changed files with 217 additions and 193 deletions
@@ -1,7 +1,7 @@
import React from "react";
import { render, screen, waitFor } from "@testing-library/react";
import { render, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { expect, test, describe, it, vi } from "vitest";
import { expect, describe, it, vi } from "vitest";
import { axe, toHaveNoViolations } from "jest-axe";
import ContextMenu from "../../app/components/ContextMenu";
import ContextMenuItem from "../../app/components/ContextMenuItem";
@@ -39,7 +39,6 @@ describe("ContextMenu Components Accessibility", () => {
});
it("has proper focus management", async () => {
const user = userEvent.setup();
render(
<ContextMenu>
<ContextMenuItem onClick={vi.fn()}>Item 1</ContextMenuItem>
@@ -249,7 +248,6 @@ describe("ContextMenu Components Accessibility", () => {
});
it("maintains proper focus order", async () => {
const user = userEvent.setup();
render(<TestMenu />);
const items = screen.getAllByRole("menuitem");
@@ -340,7 +338,6 @@ describe("ContextMenu Components Accessibility", () => {
});
it("announces selection state changes", async () => {
const user = userEvent.setup();
const { rerender } = render(
<ContextMenuItem onClick={vi.fn()} selected={false}>
Test Item
+1 -2
View File
@@ -1,7 +1,7 @@
import React from "react";
import { render, screen, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { expect, test, describe, it, vi } from "vitest";
import { expect, describe, it, vi } from "vitest";
import { axe, toHaveNoViolations } from "jest-axe";
import Select from "../../app/components/Select";
@@ -136,7 +136,6 @@ describe("Select Component Accessibility", () => {
describe("Screen Reader Support", () => {
it("announces selected option", async () => {
const user = userEvent.setup();
render(<Select {...defaultProps} value="option2" />);
const selectButton = screen.getByRole("button");
+1 -1
View File
@@ -1,4 +1,4 @@
import { expect, test, describe, it, vi } from "vitest";
import { expect, test, describe, vi } from "vitest";
import { render, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { axe, toHaveNoViolations } from "jest-axe";
+1 -1
View File
@@ -1,4 +1,4 @@
import { expect, test, describe, it, vi } from "vitest";
import { expect, test, describe, vi } from "vitest";
import { render, screen, fireEvent } from "@testing-library/react";
import { axe, toHaveNoViolations } from "jest-axe";
import Toggle from "../../app/components/Toggle";
@@ -102,9 +102,9 @@ test.describe("Accessibility Testing", () => {
// Test Enter key activation
await page.keyboard.press("Enter");
await page.waitForTimeout(100); // Brief pause to see if action occurs
} catch (error) {
} catch (_error) {
// If focus fails, skip this button
console.log(`Could not focus button ${i}: ${error.message}`);
console.log(`Could not focus button ${i}: ${_error.message}`);
continue;
}
}
@@ -332,7 +332,7 @@ test.describe("Accessibility Testing", () => {
// Page should handle errors gracefully
await expect(page.locator("body")).toBeVisible();
} catch (error) {
} catch (_error) {
// If reload fails, that's also acceptable - page should handle errors gracefully
await expect(page.locator("body")).toBeVisible();
}
@@ -168,7 +168,6 @@ describe("RadioButton Accessibility", () => {
});
it("maintains focus management", async () => {
const user = userEvent.setup();
const handleChange = vi.fn();
const { rerender } = render(
@@ -227,7 +227,6 @@ describe("RadioGroup Accessibility", () => {
});
it("maintains focus management", async () => {
const user = userEvent.setup();
const handleChange = vi.fn();
const { rerender } = render(
+5 -5
View File
@@ -39,9 +39,9 @@ describe("Accessibility - Component Level", () => {
// Check for proper heading structure (optional for header components)
try {
const headings = screen.getAllByRole("heading");
screen.getAllByRole("heading");
// Headings are not required in header components, so this is optional
} catch (error) {
} catch {
// No headings found, which is fine for a header component
}
});
@@ -119,10 +119,10 @@ describe("Accessibility - Component Level", () => {
try {
element.focus();
expect(element).toHaveFocus();
} catch (error) {
} catch {
// Some elements might not be focusable in test environment
// This is acceptable for accessibility testing
console.log(`Could not focus element: ${error.message}`);
// Intentionally ignore focus failures in JSDOM
}
});
});
@@ -144,7 +144,7 @@ describe("Accessibility - Component Level", () => {
let headings;
try {
headings = screen.getAllByRole("heading");
} catch (error) {
} catch {
// No headings found, which is fine for a header component
return;
}