fix(office): route setup cancel to homepage (#1333)
This commit is contained in:
@@ -198,7 +198,7 @@ export function SetupWizard({
|
||||
}
|
||||
}, [router]);
|
||||
|
||||
const closeHref = mode === "new" ? "/office" : "/";
|
||||
const closeHref = "/";
|
||||
|
||||
if (!showWizard) {
|
||||
return (
|
||||
|
||||
@@ -140,7 +140,7 @@ export class SessionPage {
|
||||
const attemptTimeout =
|
||||
opts.attemptTimeout ?? Math.min(15_000, Math.max(5_000, Math.floor(softTotalTimeout / 3)));
|
||||
const pollSlice = 1_500;
|
||||
const idle = this.idleInput();
|
||||
const idle = this.anyIdleInput();
|
||||
const start = Date.now();
|
||||
let reloaded = false;
|
||||
|
||||
@@ -299,6 +299,14 @@ export class SessionPage {
|
||||
return this.page.locator('[data-placeholder="Continue working on the task..."]');
|
||||
}
|
||||
|
||||
/** Chat input placeholder when agent is idle in any current mode. */
|
||||
anyIdleInput(): Locator {
|
||||
return this.page
|
||||
.locator('[data-placeholder="Continue working on the task..."]')
|
||||
.or(this.page.locator('[data-placeholder="Continue working on the plan..."]'))
|
||||
.or(this.page.locator('[data-placeholder="Continue working on the file..."]'));
|
||||
}
|
||||
|
||||
/** Chat input placeholder when agent is idle (plan mode). */
|
||||
planModeInput(): Locator {
|
||||
return this.page.locator('[data-placeholder="Continue working on the plan..."]');
|
||||
|
||||
@@ -41,6 +41,18 @@ test.describe("Office onboarding — mobile layout", () => {
|
||||
expect(box.y + box.height).toBeLessThanOrEqual(viewport.height);
|
||||
});
|
||||
|
||||
test("close button returns to homepage on mobile when adding a workspace", async ({
|
||||
testPage,
|
||||
officeSeed: _,
|
||||
}) => {
|
||||
await testPage.goto(SETUP_ROUTE);
|
||||
await expect(testPage.getByRole("heading", { name: STEP_0_HEADING })).toBeVisible();
|
||||
|
||||
await testPage.getByRole("button", { name: "Cancel" }).click();
|
||||
|
||||
await expect(testPage).toHaveURL((url) => url.pathname === "/", { timeout: 10_000 });
|
||||
});
|
||||
|
||||
test("agent step (Step 1) fits within the viewport horizontally", async ({
|
||||
testPage,
|
||||
officeSeed: _,
|
||||
|
||||
@@ -74,7 +74,7 @@ test.describe("Onboarding", () => {
|
||||
});
|
||||
});
|
||||
|
||||
test('"Add workspace" button navigates to setup with mode=new', async ({
|
||||
test('"Add workspace" button opens setup and close returns to homepage', async ({
|
||||
testPage,
|
||||
officeSeed: _,
|
||||
}) => {
|
||||
@@ -91,9 +91,12 @@ test.describe("Onboarding", () => {
|
||||
).toBeVisible({
|
||||
timeout: 10_000,
|
||||
});
|
||||
|
||||
await testPage.getByRole("button", { name: "Cancel" }).click();
|
||||
await expect(testPage).toHaveURL((url) => url.pathname === "/", { timeout: 10_000 });
|
||||
});
|
||||
|
||||
test("cancel button returns to dashboard when adding a new workspace", async ({
|
||||
test("cancel button returns to homepage when adding a new workspace", async ({
|
||||
testPage,
|
||||
officeSeed: _,
|
||||
}) => {
|
||||
@@ -104,10 +107,7 @@ test.describe("Onboarding", () => {
|
||||
|
||||
await testPage.getByRole("button", { name: "Cancel" }).click();
|
||||
|
||||
await expect(testPage).toHaveURL(/\/office$/, { timeout: 10_000 });
|
||||
await expect(testPage.getByRole("heading", { name: /Dashboard/i }).first()).toBeVisible({
|
||||
timeout: 10_000,
|
||||
});
|
||||
await expect(testPage).toHaveURL((url) => url.pathname === "/", { timeout: 10_000 });
|
||||
});
|
||||
|
||||
test("inline CLI profile creation selects the profile for the new agent", async ({
|
||||
|
||||
Reference in New Issue
Block a user