This commit is contained in:
+35
-35
@@ -1,12 +1,11 @@
|
||||
import { test, expect, type Page } from '@playwright/test';
|
||||
|
||||
// ── Tasks page sub-tabs (タスク / ファイル / 設定) ─────────────────────────────
|
||||
// ── M2: Tasks tab removed, workspace one-true-home ────────────────────────────
|
||||
//
|
||||
// The Tasks page gained a sub-tab strip that surfaces the user's PERSONAL
|
||||
// workspace files + settings without leaving the page. The default sub-tab
|
||||
// (タスク) keeps the existing list+detail behavior; ファイル reuses the same
|
||||
// <SpaceFiles> the Spaces page uses (testid `space-files`); 設定 reuses
|
||||
// <SpaceSettings> (nav testid `space-settings-nav-agents`).
|
||||
// The top-level "タスク" tab was removed; normal use is now entirely through
|
||||
// Workspaces (spaces). On startup the personal workspace opens automatically so
|
||||
// the user never lands on an empty rail. Legacy `?page=tasks` deep links are
|
||||
// normalized onto the workspace model (Option A redirect) at load time.
|
||||
//
|
||||
// With auth disabled the /api/auth/me probe 404s on purpose and the UI falls
|
||||
// back to the synthetic local user; the personal workspace is auto-created on
|
||||
@@ -44,45 +43,46 @@ function trackFatalErrors(page: Page): string[] {
|
||||
return fatalErrors;
|
||||
}
|
||||
|
||||
test('tasks page: タスク / ファイル / 設定 sub-tabs switch the content area', async ({ page }) => {
|
||||
test('nav: the Tasks tab no longer exists', async ({ page }) => {
|
||||
const fatalErrors = trackFatalErrors(page);
|
||||
|
||||
// Tasks is the default page.
|
||||
await page.goto('/ui');
|
||||
|
||||
// 1. The sub-tab strip and all three sub-tabs render.
|
||||
const strip = page.getByTestId('tasks-subtabs');
|
||||
await expect(strip).toBeVisible();
|
||||
await expect(page.getByTestId('tasks-subtab-tasks')).toBeVisible();
|
||||
await expect(page.getByTestId('tasks-subtab-files')).toBeVisible();
|
||||
await expect(page.getByTestId('tasks-subtab-settings')).toBeVisible();
|
||||
|
||||
// 2. ファイル shows the personal-workspace file view (reused SpaceFiles).
|
||||
await page.getByTestId('tasks-subtab-files').click();
|
||||
await expect(page.getByTestId('space-files')).toBeVisible();
|
||||
// URL state persists the active sub-tab for shareable/back-button behavior.
|
||||
await expect(page).toHaveURL(/[?&]tasksTab=files(&|$)/);
|
||||
|
||||
// 3. 設定 shows the personal-workspace settings (reused SpaceSettings nav).
|
||||
await page.getByTestId('tasks-subtab-settings').click();
|
||||
await expect(page.getByTestId('space-settings-nav-agents')).toBeVisible();
|
||||
await expect(page).toHaveURL(/[?&]tasksTab=settings(&|$)/);
|
||||
|
||||
// 4. タスク returns to the task list (default state, no tasksTab param).
|
||||
await page.getByTestId('tasks-subtab-tasks').click();
|
||||
await expect(page.getByTestId('space-files')).toHaveCount(0);
|
||||
await expect(page.getByTestId('space-settings-nav-agents')).toHaveCount(0);
|
||||
await expect(page).not.toHaveURL(/[?&]tasksTab=/);
|
||||
// The removed top-level Tasks tab must not render in either layout.
|
||||
await expect(page.getByTestId('nav-tasks')).toHaveCount(0);
|
||||
// Workspaces is present (the new home).
|
||||
await expect(page.getByTestId('nav-spaces')).toBeVisible();
|
||||
// Removed sub-tab strip must be gone.
|
||||
await expect(page.getByTestId('tasks-subtabs')).toHaveCount(0);
|
||||
|
||||
expect(fatalErrors).toEqual([]);
|
||||
});
|
||||
|
||||
test('tasks page: tasksTab=files deep-link lands on the files sub-tab', async ({ page }) => {
|
||||
test('startup opens the workspaces page (personal workspace auto-selected)', async ({ page }) => {
|
||||
const fatalErrors = trackFatalErrors(page);
|
||||
|
||||
await page.goto('/ui?tasksTab=files');
|
||||
await expect(page.getByTestId('tasks-subtabs')).toBeVisible();
|
||||
await expect(page.getByTestId('space-files')).toBeVisible();
|
||||
await page.goto('/ui');
|
||||
|
||||
// Spaces is the default page; the rail + a selected workspace detail render
|
||||
// (the personal workspace is auto-opened so the rail is never empty).
|
||||
await expect(page.getByTestId('space-detail')).toBeVisible();
|
||||
// We must NOT be on the legacy tasks page.
|
||||
expect(page.url()).not.toContain('page=tasks');
|
||||
|
||||
expect(fatalErrors).toEqual([]);
|
||||
});
|
||||
|
||||
test('legacy ?page=tasks deep link redirects onto the workspace model', async ({ page }) => {
|
||||
const fatalErrors = trackFatalErrors(page);
|
||||
|
||||
await page.goto('/ui?page=tasks');
|
||||
|
||||
// The legacy page=tasks is normalized away (Option A) and the workspace
|
||||
// detail surfaces instead.
|
||||
await expect(page.getByTestId('space-detail')).toBeVisible();
|
||||
await expect.poll(() => page.url()).not.toContain('page=tasks');
|
||||
// The personal workspace is targeted via the space param.
|
||||
await expect.poll(() => page.url()).toMatch(/[?&]space=/);
|
||||
|
||||
expect(fatalErrors).toEqual([]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user