mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
chore(lint): no-shadow in small app test/e2e files
This commit is contained in:
@@ -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]));
|
||||
|
||||
@@ -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",
|
||||
},
|
||||
|
||||
@@ -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 },
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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", () => {
|
||||
|
||||
@@ -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" })),
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user