Files
kandev/apps/web/e2e/tests/task/mobile-external-link-menu.spec.ts
T
2026-07-13 13:56:55 +01:00

69 lines
2.4 KiB
TypeScript

import { test, expect } from "../../fixtures/test-base";
import { SessionPage } from "../../pages/session-page";
test.describe("Mobile sidebar — external link menu", () => {
test("shows enabled integration link actions in the task switcher sheet", async ({
testPage,
apiClient,
seedData,
}) => {
await apiClient.setJiraConfig({
siteUrl: "https://acme.atlassian.net",
email: "alice@example.com",
secret: "api-token-value",
});
await apiClient.setLinearConfig({ secret: "lin_api_xxx" });
const sentry = await apiClient.createSentryInstance({
workspaceId: seedData.workspaceId,
name: "Sentry",
secret: "sntrys_xxx",
});
await apiClient.mockSentrySetAuthHealth({ instanceId: sentry.id, ok: true });
await Promise.all([
apiClient.waitForIntegrationAuthHealthy("jira"),
apiClient.waitForIntegrationAuthHealthy("linear"),
apiClient.waitForIntegrationAuthHealthy("sentry", { workspaceId: seedData.workspaceId }),
]);
const task = await apiClient.seedTask(seedData.workspaceId, "Mobile external link task", {
workflow_id: seedData.workflowId,
workflow_step_id: seedData.startStepId,
});
await testPage.goto(`/t/${task.task_id}`);
const session = new SessionPage(testPage);
await session.waitForLoad();
await testPage.getByTestId("mobile-session-menu").click();
const sheet = testPage.getByRole("dialog");
const taskRow = sheet.locator('[role="button"]').filter({
hasText: "Mobile external link task",
});
await expect(taskRow).toBeVisible({ timeout: 10_000 });
await taskRow.dispatchEvent("pointerdown", {
pointerType: "touch",
isPrimary: true,
button: 0,
clientX: 120,
clientY: 240,
});
await testPage.waitForTimeout(1000);
await taskRow.dispatchEvent("pointerup", {
pointerType: "touch",
isPrimary: true,
button: 0,
clientX: 120,
clientY: 240,
});
const linkTrigger = testPage.getByRole("menuitem", { name: /^Link$/ });
await expect(linkTrigger).toBeVisible();
await linkTrigger.focus();
await testPage.keyboard.press("ArrowRight");
await expect(testPage.getByRole("menuitem", { name: "Jira Ticket" })).toBeVisible();
await expect(testPage.getByRole("menuitem", { name: "Linear Issue" })).toBeVisible();
await expect(testPage.getByRole("menuitem", { name: "Sentry Issue" })).toBeVisible();
});
});