diff --git a/tests/e2e/linear-url-workspace-entry.spec.ts b/tests/e2e/linear-url-workspace-entry.spec.ts index 16491a785db..e7e6b758780 100644 --- a/tests/e2e/linear-url-workspace-entry.spec.ts +++ b/tests/e2e/linear-url-workspace-entry.spec.ts @@ -3,6 +3,7 @@ import type { ElectronApplication, Page } from '@stablyai/playwright-test' import { test, expect } from './helpers/orca-app' import { waitForActiveWorktree, waitForSessionReady } from './helpers/store' import type { LinearIssue } from '../../src/shared/linear/issue-types' +import type { LinearConnectionStatus } from '../../src/shared/linear/workspace-types' const LINEAR_URL = 'https://linear.app/stably/issue/STA-4084/restore-osc-133-shell-integration-when-an-exec-in-user-rc-files-strips' @@ -25,6 +26,31 @@ const LINEAR_ISSUE: LinearIssue = { updatedAt: '2026-08-12T00:00:00.000Z' } +const LINEAR_STATUS: LinearConnectionStatus = { + connected: true, + viewer: null, + activeWorkspaceId: 'workspace-other', + selectedWorkspaceId: 'workspace-other', + workspaces: [ + { + id: 'workspace-other', + displayName: 'Other User', + email: null, + organizationId: 'organization-other', + organizationName: 'Other', + organizationUrlKey: 'other' + }, + { + id: 'workspace-1', + displayName: 'Stably User', + email: null, + organizationId: 'organization-stably', + organizationName: 'Stably', + organizationUrlKey: 'stably' + } + ] +} + declare global { // oxlint-disable-next-line typescript-eslint/consistent-type-definitions -- declaration merging requires interface interface Window { @@ -43,37 +69,14 @@ async function installLinearFixture( lookupDelayMs: number | null = 150 ): Promise { await page.evaluate( - ({ resolvedIssue, lookupDelayMs }) => { + ({ resolvedIssue, lookupDelayMs, status }) => { Reflect.deleteProperty(window, '__orcaTestReleaseLinearLookup') const store = window.__store if (!store) { throw new Error('window.__store is not available') } store.setState({ - linearStatus: { - connected: true, - viewer: null, - activeWorkspaceId: 'workspace-other', - selectedWorkspaceId: 'workspace-other', - workspaces: [ - { - id: 'workspace-other', - displayName: 'Other User', - email: null, - organizationId: 'organization-other', - organizationName: 'Other', - organizationUrlKey: 'other' - }, - { - id: 'workspace-1', - displayName: 'Stably User', - email: null, - organizationId: 'organization-stably', - organizationName: 'Stably', - organizationUrlKey: 'stably' - } - ] - }, + linearStatus: status, linearStatusChecked: true, checkLinearConnection: async () => {}, searchLinearIssues: async () => [], @@ -88,7 +91,7 @@ async function installLinearFixture( } }) }, - { resolvedIssue: issue, lookupDelayMs } + { resolvedIssue: issue, lookupDelayMs, status: LINEAR_STATUS } ) } @@ -121,9 +124,14 @@ async function openJumpPalette(electronApp: ElectronApplication): Promise } test.describe('Linear URL workspace entry', () => { - test.beforeEach(async ({ orcaPage }) => { + test.beforeEach(async ({ electronApp, orcaPage }) => { await waitForSessionReady(orcaPage) await waitForActiveWorktree(orcaPage) + // Why: Create worktree reads Linear status from its repo's host, not the store. + await electronApp.evaluate(({ ipcMain }, status) => { + ipcMain.removeHandler('linear:status') + ipcMain.handle('linear:status', () => status) + }, LINEAR_STATUS) await installLinearFixture(orcaPage) }) @@ -210,7 +218,7 @@ test.describe('Linear URL workspace entry', () => { await openJumpPalette(electronApp) const palette = orcaPage.getByRole('dialog', { name: 'Jump to...' }) const input = palette.getByPlaceholder( - 'Search chats, terminals, worktrees, settings, and actions...' + 'Search chats, terminals, workspaces, tasks, settings, and actions...' ) await expect(input).toBeVisible() diff --git a/tests/e2e/os-opened-documents.spec.ts b/tests/e2e/os-opened-documents.spec.ts index cd25dd593e4..54d70eb878d 100644 --- a/tests/e2e/os-opened-documents.spec.ts +++ b/tests/e2e/os-opened-documents.spec.ts @@ -36,15 +36,16 @@ for (const extension of ['md', 'csv', 'tsv'] as const) { try { launched = await session.launch({ extraArgs: [coldPath, pathToFileURL(coldPath).href] }) const { app, page } = launched - const table = page.getByRole('table') + // OS-opened CSVs are editable, so they render as an ARIA grid rather than a table. + const grid = page.getByRole('grid', { name: 'CSV editor' }) const coldResult = extension === 'md' ? page.getByRole('heading', { name: 'Cold result' }) - : table.getByRole('cell', { name: 'Cold result', exact: true }) + : grid.getByRole('gridcell', { name: 'Cold result', exact: true }) const warmResult = extension === 'md' ? page.getByRole('heading', { name: 'Warm result' }) - : table.getByRole('cell', { name: 'Warm result', exact: true }) + : grid.getByRole('gridcell', { name: 'Warm result', exact: true }) await expect(coldResult).toBeVisible() await expect(page.getByText('42', { exact: true })).toBeVisible() await expect( diff --git a/tests/e2e/profile-state-save-delay.spec.ts b/tests/e2e/profile-state-save-delay.spec.ts index 2bbb689596b..fdda22e865d 100644 --- a/tests/e2e/profile-state-save-delay.spec.ts +++ b/tests/e2e/profile-state-save-delay.spec.ts @@ -31,7 +31,8 @@ test('shows one delayed-save notice, restores it after reload, and clears on rec await expect(notice).toHaveCount(1) await expect(notice).toBeVisible() await expect(notice).toContainText('Further saves may be delayed while this operation finishes.') - await expect(notice.getByRole('button')).toHaveCount(0) + // The app toaster's close button is the only control; the notice has no action button. + await expect(notice.getByRole('button')).toHaveAttribute('data-close-button') await expect(notice).toHaveCSS('opacity', '1') const screenshot = testInfo.outputPath('delayed-save-notice.png') await orcaPage.screenshot({ path: screenshot }) diff --git a/tests/e2e/workspace-emoji-picker.spec.ts b/tests/e2e/workspace-emoji-picker.spec.ts index f16499a22bc..f5866bd44a5 100644 --- a/tests/e2e/workspace-emoji-picker.spec.ts +++ b/tests/e2e/workspace-emoji-picker.spec.ts @@ -56,7 +56,7 @@ test.describe('Workspace emoji picker', () => { }) }) - const detailsDialog = orcaPage.getByRole('dialog', { name: 'Edit Worktree Details' }) + const detailsDialog = orcaPage.getByRole('dialog', { name: 'Workspace details' }) const displayNameInput = detailsDialog.getByPlaceholder('Custom display name...') await expect(displayNameInput).toBeFocused() await displayNameInput.fill('Details proof') @@ -72,7 +72,7 @@ test.describe('Workspace emoji picker', () => { await orcaPage.evaluate(() => window.__store!.getState().openModal('worktree-palette')) const palette = orcaPage.getByRole('dialog', { name: 'Jump to...' }) const paletteInput = palette.getByPlaceholder( - 'Search chats, terminals, worktrees, settings, and actions...' + 'Search chats, terminals, workspaces, tasks, settings, and actions...' ) await expect(paletteInput).toBeFocused() await captureProof(orcaPage, testInfo, 'cmd-j-before.png')