chore(lint): no-shadow in small app test/e2e files

This commit is contained in:
Mohamed Boudra
2026-04-24 05:15:58 +07:00
parent b13725ea7a
commit aaf0e5065e
6 changed files with 12 additions and 12 deletions

View File

@@ -67,7 +67,7 @@ test.beforeEach(async ({ page }) => {
const createAgentPreferences = buildCreateAgentPreferences(testDaemon.serverId);
await page.addInitScript(
({ daemon, preferences, seedNonce }) => {
({ daemon, preferences, seedNonce: nonce }) => {
// `addInitScript` runs on every navigation (including reloads). Some tests intentionally
// override storage and reload; they can opt out of seeding for the *next* navigation by
// setting this flag before the reload.
@@ -75,13 +75,13 @@ test.beforeEach(async ({ page }) => {
const disableValue = localStorage.getItem(disableOnceKey);
if (disableValue) {
localStorage.removeItem(disableOnceKey);
if (disableValue === seedNonce) {
if (disableValue === nonce) {
return;
}
}
localStorage.setItem("@paseo:e2e", "1");
localStorage.setItem("@paseo:e2e-seed-nonce", seedNonce);
localStorage.setItem("@paseo:e2e-seed-nonce", nonce);
// Hard-reset anything that could point to a developer's real daemon.
localStorage.setItem("@paseo:daemon-registry", JSON.stringify([daemon]));

View File

@@ -140,12 +140,12 @@ test.describe("Workspace navigation regression", () => {
await expect(page.locator('[data-testid^="workspace-deck-entry-"]')).toHaveCount(2);
await page.evaluate(
({ agentId, serverId }) => {
({ agentId, serverId: targetServerId }) => {
globalThis.dispatchEvent(
new CustomEvent("paseo:web-notification-click", {
detail: {
data: {
serverId,
serverId: targetServerId,
agentId,
reason: "finished",
},

View File

@@ -7,13 +7,13 @@ import { createRoot, type Root } from "react-dom/client";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
const { panelState, useSidebarWorkspacesListMock, theme } = vi.hoisted(() => {
const panelState = {
const hoistedPanelState = {
isOpen: false,
showMobileAgent: vi.fn(),
};
return {
panelState,
panelState: hoistedPanelState,
useSidebarWorkspacesListMock: vi.fn(),
theme: {
spacing: { 0: 0, 0.5: 2, 1: 4, 1.5: 6, 2: 8, 3: 12, 4: 16, 5: 20 },

View File

@@ -76,10 +76,10 @@ async function renderActivityHook({
client?: ReturnType<typeof createTestClient>;
focusedAgentId?: string | null;
} = {}) {
function Probe({ focusedAgentId }: { focusedAgentId: string | null }) {
function Probe({ focusedAgentId: probeFocusedAgentId }: { focusedAgentId: string | null }) {
useClientActivity({
client: client as unknown as Parameters<typeof useClientActivity>[0]["client"],
focusedAgentId,
focusedAgentId: probeFocusedAgentId,
});
return null;
}

View File

@@ -185,7 +185,7 @@ describe("buildSidebarProjectsFromStructure", () => {
],
});
expect(projects.map((project) => project.projectKey)).toEqual(["project-b", "project-a"]);
expect(projects.map((entry) => entry.projectKey)).toEqual(["project-b", "project-a"]);
});
it("preserves the structure hook workspace order", () => {

View File

@@ -10,7 +10,7 @@ import { createRoot } from "react-dom/client";
import { WorkspaceScriptsButton } from "@/screens/workspace/workspace-scripts-button";
const { theme, startWorkspaceScriptMock } = vi.hoisted(() => {
const theme = {
const hoistedTheme = {
spacing: { 1: 4, 1.5: 6, 2: 8, 3: 12 },
borderWidth: { 1: 1 },
borderRadius: { md: 6 },
@@ -30,7 +30,7 @@ const { theme, startWorkspaceScriptMock } = vi.hoisted(() => {
};
return {
theme,
theme: hoistedTheme,
startWorkspaceScriptMock: vi.fn(async () => ({ terminalId: "terminal-script-1" })),
};
});