52 lines
1.9 KiB
TypeScript
52 lines
1.9 KiB
TypeScript
import { expect, test } from "../../fixtures/test-base";
|
|
import { useRegularMode } from "../../helpers/regular-mode";
|
|
import { MobileKanbanPage } from "../../pages/mobile-kanban-page";
|
|
import { expectTaskDescription } from "../../pages/task-description-editor";
|
|
|
|
useRegularMode();
|
|
|
|
test("keeps Create Task open after hardware-keyboard Escape on mobile", async ({
|
|
testPage,
|
|
prCapture,
|
|
}) => {
|
|
const mobile = new MobileKanbanPage(testPage);
|
|
await mobile.goto();
|
|
await mobile.mobileFab.tap();
|
|
|
|
const dialog = testPage.getByTestId("create-task-dialog");
|
|
const textarea = dialog.getByTestId("task-description-input");
|
|
await expect(dialog).toHaveAttribute("data-state", "open");
|
|
await textarea.fill("Keep this mobile draft");
|
|
|
|
await textarea.press("Escape");
|
|
|
|
await expect(dialog).toHaveAttribute("data-state", "open");
|
|
await expectTaskDescription(textarea, "Keep this mobile draft");
|
|
await expect(textarea).toBeFocused();
|
|
await prCapture.screenshot("create-task-dialog-after-escape-mobile", {
|
|
caption: "Create Task stays open with the draft after Escape on mobile.",
|
|
});
|
|
});
|
|
|
|
test("closes prompt autocomplete and keeps focus after hardware-keyboard Escape on mobile", async ({
|
|
testPage,
|
|
}) => {
|
|
const mobile = new MobileKanbanPage(testPage);
|
|
await mobile.goto();
|
|
await mobile.mobileFab.tap();
|
|
|
|
const dialog = testPage.getByTestId("create-task-dialog");
|
|
const textarea = dialog.getByTestId("task-description-input");
|
|
const menuTitle = testPage.getByText(/Mention tasks, files, prompts/i);
|
|
await textarea.pressSequentially("@");
|
|
await expect(menuTitle).toBeVisible();
|
|
|
|
await testPage.keyboard.press("Escape");
|
|
|
|
await expect(menuTitle).toHaveCount(0);
|
|
await expect(dialog).toHaveAttribute("data-state", "open");
|
|
await expect(textarea).toBeFocused();
|
|
await textarea.pressSequentially("continued");
|
|
await expectTaskDescription(textarea, "@continued");
|
|
});
|