Files
kandev/apps/web/e2e/tests/task/mobile-executor-embedded-vscode-availability.spec.ts
T
2026-07-30 22:24:16 +01:00

51 lines
1.5 KiB
TypeScript

import { test, expect } from "../../fixtures/test-base";
import type { ApiClient } from "../../helpers/api-client";
import type { Page } from "@playwright/test";
import { SessionPage } from "../../pages/session-page";
async function seedTask(
page: Page,
apiClient: ApiClient,
seedData: {
workspaceId: string;
workflowId: string;
startStepId: string;
agentProfileId: string;
},
) {
const task = await apiClient.createTaskWithAgent(
seedData.workspaceId,
"Mobile executor editor availability",
seedData.agentProfileId,
{
description: "/e2e:simple-message",
workflow_id: seedData.workflowId,
workflow_step_id: seedData.startStepId,
repository_ids: [],
},
);
await page.goto(`/t/${task.id}`);
const session = new SessionPage(page);
await session.waitForLoad();
}
test("executor capability keeps the intentional mobile topbar without desktop editor controls", async ({
testPage,
apiClient,
seedData,
prCapture,
}) => {
await seedTask(testPage, apiClient, seedData);
await expect(testPage.getByTestId("mobile-session-menu")).toBeVisible();
await expect(testPage.getByTestId("editors-menu-list")).toHaveCount(0);
const width = await testPage.evaluate(() => ({
client: document.documentElement.clientWidth,
scroll: document.documentElement.scrollWidth,
}));
expect(width.scroll).toBeLessThanOrEqual(width.client + 1);
await prCapture.screenshot("executor-editor-menu-mobile", {
caption: "Mobile task topbar remains compact for every executor capability",
});
});