From deedc556c0a2e27aa981ff259780bf7664dd2c07 Mon Sep 17 00:00:00 2001 From: Brian Love Date: Wed, 20 May 2026 16:51:25 -0700 Subject: [PATCH] test(e2e-harness): delete broken test-helpers.spec.ts; document strategy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The spec imported `SendPromptAndWaitOptions` which was removed in PR #472 (harness helper consolidation), leaving a tsc error in the lint target that has been silently failing the Library — lint gate. The chat-sidenav- scrim no-output-native noise (resolved by #485) was masking it; subsequent admin-merges let it through. Two-part fix: 1. Delete the spec. Its original purpose ("locks in the type contract") was already covered by tsc itself; the deleted type meant the spec was just verifying a removed API. 2. Document the testing strategy in a header block on test-helpers.ts so future contributors know the absence of unit tests is intentional: - The 3 Playwright-dependent helpers are exercised end-to-end by the 24 cockpit cap aimock e2es in the matrix. - `startAimock` (the only helper testable without a Page) has its own aimock-runner.spec.ts in the same directory. Identified during the post-Task-#4 e2e audit (item #8). Co-Authored-By: Claude Opus 4.7 (1M context) --- libs/e2e-harness/src/test-helpers.spec.ts | 18 ------------------ libs/e2e-harness/src/test-helpers.ts | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 18 deletions(-) delete mode 100644 libs/e2e-harness/src/test-helpers.spec.ts diff --git a/libs/e2e-harness/src/test-helpers.spec.ts b/libs/e2e-harness/src/test-helpers.spec.ts deleted file mode 100644 index 4c90d300..00000000 --- a/libs/e2e-harness/src/test-helpers.spec.ts +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-License-Identifier: MIT -import { describe, it, expect } from 'vitest'; -import type { SendPromptAndWaitOptions } from './test-helpers'; - -// The helper itself is integration-level (drives a real Playwright page); -// per-example specs exercise it. This file just locks in the type contract. - -describe('SendPromptAndWaitOptions', () => { - it('accepts an empty options object', () => { - const opts: SendPromptAndWaitOptions = {}; - expect(opts.path).toBeUndefined(); - }); - - it('accepts a path override', () => { - const opts: SendPromptAndWaitOptions = { path: '/embed' }; - expect(opts.path).toBe('/embed'); - }); -}); diff --git a/libs/e2e-harness/src/test-helpers.ts b/libs/e2e-harness/src/test-helpers.ts index 47d11495..de8e844d 100644 --- a/libs/e2e-harness/src/test-helpers.ts +++ b/libs/e2e-harness/src/test-helpers.ts @@ -1,4 +1,20 @@ // SPDX-License-Identifier: MIT +// +// Testing strategy for the helpers in this file: +// +// These helpers orchestrate Playwright `Page` APIs — `goto`, `getByRole`, +// `locator`, `click`, `expect.toBeAttached/toBeVisible`. Unit-testing them +// with a mock Page would mostly verify our wiring of Playwright's API, not +// real behavior. +// +// Authoritative behavioral coverage lives in the cockpit cap aimock e2es +// (24 specs across cockpit/{chat,langgraph,deep-agents}/*/angular/e2e/), +// each of which exercises one of these helpers against a real Playwright +// page driving the cap's UI through aimock-replayed responses. If any of +// these helpers regress, the matrix lights up red across many caps. +// +// `aimock-runner.spec.ts` (in this same directory) covers `startAimock` +// directly — it's the only helper testable without a real Page. import { expect, type Locator, type Page } from '@playwright/test'; /**