From 3eab6dae72f19aecf0809751b06a05fa7b3bd33f Mon Sep 17 00:00:00 2001 From: OrcaWin <293788423+OrcaWin@users.noreply.github.com> Date: Thu, 12 Nov 2026 14:21:54 -0800 Subject: [PATCH] test: remove low-value plugin frame and wrapper suites --- .../scripts/ci/sharding/ci-shard-timings.json | 3 - .../plugin-frame-document-session.test.ts | 12 --- .../frames/plugin-frame-document.test.ts | 40 +--------- .../frames/plugin-frame-facades.test.ts | 77 ------------------- .../plugins/frames/plugin-frame-guest.test.ts | 64 --------------- .../plugin-panel-message-budget.test.ts | 12 --- .../plugins/frames/plugin-panel-shell.test.ts | 54 +------------ .../plugin-git-access-failure.test.ts | 23 ------ 8 files changed, 3 insertions(+), 282 deletions(-) delete mode 100644 src/shared/plugins/frames/plugin-frame-facades.test.ts delete mode 100644 src/shared/plugins/frames/plugin-frame-guest.test.ts delete mode 100644 src/shared/plugins/frames/plugin-panel-message-budget.test.ts delete mode 100644 src/shared/plugins/installation/plugin-git-access-failure.test.ts diff --git a/config/scripts/ci/sharding/ci-shard-timings.json b/config/scripts/ci/sharding/ci-shard-timings.json index c438138598f..02b188134a4 100644 --- a/config/scripts/ci/sharding/ci-shard-timings.json +++ b/config/scripts/ci/sharding/ci-shard-timings.json @@ -6607,10 +6607,7 @@ "src/shared/plugins/declarative/testing/testing-editor-host.test.ts": 197, "src/shared/plugins/frames/plugin-frame-document-session.test.ts": 404, "src/shared/plugins/frames/plugin-frame-document.test.ts": 426, - "src/shared/plugins/frames/plugin-frame-facades.test.ts": 383, - "src/shared/plugins/frames/plugin-frame-guest.test.ts": 50, "src/shared/plugins/frames/plugin-panel-call-admission.test.ts": 89, - "src/shared/plugins/frames/plugin-panel-message-budget.test.ts": 99, "src/shared/plugins/frames/plugin-panel-shell.test.ts": 376, "src/shared/plugins/images/plugin-image-format.test.ts": 104, "src/shared/plugins/images/plugin-image-url.test.ts": 42, diff --git a/src/shared/plugins/frames/plugin-frame-document-session.test.ts b/src/shared/plugins/frames/plugin-frame-document-session.test.ts index 1ffacf2f181..2fce2bbe3d3 100644 --- a/src/shared/plugins/frames/plugin-frame-document-session.test.ts +++ b/src/shared/plugins/frames/plugin-frame-document-session.test.ts @@ -50,18 +50,6 @@ afterEach(() => { }) describe('orca.document.session', () => { - it('answers editor.flush only once the change it posted is accepted', async () => { - const { session, fromHost, posted } = await open() - session.change('b') - const flushRequest = { orca: 1, kind: 'req', id: 9, method: 'editor.flush' } - fromHost(flushRequest) - await settle() - expect(posted().at(-1)).toMatchObject({ method: 'editor.applyEdit' }) - fromHost(accept(0)) - await settle() - expect(posted().at(-1)).toEqual({ orca: 1, kind: 'res', id: 9, result: null }) - }) - it('keeps one edit in flight through a save, so the baseline never goes back', async () => { const { orca, session, fromHost, edits, posted } = await open({ debounceMs: 0 }) session.change('a1') diff --git a/src/shared/plugins/frames/plugin-frame-document.test.ts b/src/shared/plugins/frames/plugin-frame-document.test.ts index b0d5580e2c8..f993b658ca4 100644 --- a/src/shared/plugins/frames/plugin-frame-document.test.ts +++ b/src/shared/plugins/frames/plugin-frame-document.test.ts @@ -1,7 +1,7 @@ // @vitest-environment happy-dom -import { describe, expect, it, vi } from 'vitest' -import { flush, mountShell } from './plugin-frame-shell-mount.test-fixture' +import { describe, expect, it } from 'vitest' +import { mountShell } from './plugin-frame-shell-mount.test-fixture' const doc = (version: number, text: string) => ({ orca: 1, @@ -80,40 +80,4 @@ describe('orca.document.get after applyEdit', () => { content: text('outside') }) }) - - it('does not report an accepted edit as a change', async () => { - const { orca, fromHost } = mountShell('editor') - fromHost(doc(1, 'a')) - const changes = vi.fn() - orca.document!.onDidChange(changes) - await flush() - const applied = orca.document!.applyEdit({ baseVersion: 1, content: text('b') }) - fromHost(answer(0)) - await applied - expect(changes).toHaveBeenCalledTimes(1) - }) -}) - -describe('orca.document.onDidChange replay', () => { - it('skips the replay for a subscription disposed before it runs', async () => { - const { orca, fromHost } = mountShell('editor') - fromHost(doc(1, 'a')) - const changes = vi.fn() - orca.document!.onDidChange(changes).dispose() - await flush() - fromHost(doc(2, 'b')) - expect(changes).not.toHaveBeenCalled() - }) - - it('replays to subscriptions still live', async () => { - const { orca, fromHost } = mountShell('editor') - fromHost(doc(1, 'a')) - const kept = vi.fn() - const dropped = vi.fn() - orca.document!.onDidChange(kept) - orca.document!.onDidChange(dropped).dispose() - await flush() - expect(kept).toHaveBeenCalledWith(expect.objectContaining({ version: 1 })) - expect(dropped).not.toHaveBeenCalled() - }) }) diff --git a/src/shared/plugins/frames/plugin-frame-facades.test.ts b/src/shared/plugins/frames/plugin-frame-facades.test.ts deleted file mode 100644 index ef89ac0bc3f..00000000000 --- a/src/shared/plugins/frames/plugin-frame-facades.test.ts +++ /dev/null @@ -1,77 +0,0 @@ -// @vitest-environment happy-dom - -import { afterEach, describe, expect, it, vi } from 'vitest' -import { buildPluginPanelShellHtml } from './plugin-panel-shell' - -type Disposable = { dispose: () => void } -type FrameOrca = { - on: (event: string, handler: (payload: unknown) => unknown) => Disposable - plugin: { - request: (name: string, input?: unknown, options?: { timeoutMs?: number }) => Promise - on: (event: string, handler: (payload: unknown) => unknown) => Disposable - } - storage: { - get: (key: string) => Promise - set: (key: string, value: unknown) => Promise - onDidChange: (handler: (change: { key: string }) => void) => Disposable - } - settings: { get: (key?: string) => Promise } -} - -const realParent = window.parent -afterEach(() => { - Object.defineProperty(window, 'parent', { value: realParent, configurable: true }) -}) - -function mountShell() { - const parent = { postMessage: vi.fn() } - Object.defineProperty(window, 'parent', { value: parent, configurable: true }) - const script = buildPluginPanelShellHtml('
').match( - /