Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

Delete the never-run visual suite under D59 (#6427)

Nick Gomez1784a4bfdbf2
diff --git a/lint-plugins/ok-rules/README.md b/lint-plugins/ok-rules/README.md
index 5d73bd693..5b9eb00bd 100644
--- a/lint-plugins/ok-rules/README.md
+++ b/lint-plugins/ok-rules/README.md
@@ -232,7 +232,7 @@ Rule: [`lint-plugins/ok-rules/rules/class-proof-registration-discipline.mjs`](ru
Flags `expect(await locator.count())` — the one-shot count snapshot that never retries. Under CI CPU contention the DOM settles a few frames after the read, so the assertion flakes while the auto-retrying web-first form `await expect(locator).toHaveCount(n)` passes deterministically (the no-retry read was one of the hidden-flake shapes in the 2026-06 e2e CI audit). The pattern matches the probe sub-expression regardless of the matcher that follows (`.toBe`, `.toEqual`, `.toBeGreaterThanOrEqual`, ...). Upstream precedent: eslint-plugin-playwright `prefer-to-have-count`.
-**Scoped** (see the rule's `RULE_SCOPES` entry in [`scope.mjs`](scope.mjs)) to `packages/app/tests/{stress,a11y}/**/*.e2e.ts` (two of the three dirs `tests/integration/e2e-stop-rules.test.ts` source-scans; that scan also covers `tests/visual`, whose spec has no route and awaits deletion) + the fixture. Not workspace-wide: outside Playwright specs, `.count()` is usually not a `Locator` and the web-first rewrite does not apply.
+**Scoped** (see the rule's `RULE_SCOPES` entry in [`scope.mjs`](scope.mjs)) to `packages/app/tests/{stress,a11y}/**/*.e2e.ts` (the two dirs `tests/integration/e2e-stop-rules.test.ts` source-scans) + the fixture. Not workspace-wide: outside Playwright specs, `.count()` is usually not a `Locator` and the web-first rewrite does not apply.
The rule does NOT catch:
- `expect.soft(await locator.count())` — different callee node shape; zero occurrences today.
diff --git a/packages/app/tests/integration/e2e-stop-rules.reads.ts b/packages/app/tests/integration/e2e-stop-rules.reads.ts
index eab99139a..b7191b3a2 100644
--- a/packages/app/tests/integration/e2e-stop-rules.reads.ts
+++ b/packages/app/tests/integration/e2e-stop-rules.reads.ts
@@ -1,10 +1,6 @@
import { TEST_ONLY_SOURCE_SUFFIXES } from '../../../../test-support/test-only-source-file.mjs';
-export const E2E_SCAN_ROOTS = [
- 'packages/app/tests/stress',
- 'packages/app/tests/visual',
- 'packages/app/tests/a11y',
-];
+export const E2E_SCAN_ROOTS = ['packages/app/tests/stress', 'packages/app/tests/a11y'];
export const APP_SOURCE_ROOT = 'packages/app/src';
export const APP_SOURCE_EXTENSIONS = ['.ts', '.tsx'];
export const APP_SOURCE_EXCLUDED_SUFFIXES = [...TEST_ONLY_SOURCE_SUFFIXES, '.spec.ts', '.spec.tsx'];
diff --git a/packages/app/tests/integration/e2e-stop-rules.test.ts b/packages/app/tests/integration/e2e-stop-rules.test.ts
index 307c5e1d4..d95365dc9 100644
--- a/packages/app/tests/integration/e2e-stop-rules.test.ts
+++ b/packages/app/tests/integration/e2e-stop-rules.test.ts
@@ -615,7 +615,7 @@ describe('E2E STOP rule — zero allowlist', () => {
}
});
- test('no page.waitForTimeout( in tests/{stress,visual,a11y}/*.e2e.ts (AC-3)', () => {
+ test('no page.waitForTimeout( in tests/{stress,a11y}/*.e2e.ts (AC-3)', () => {
const violations = collectMatches(e2eFiles, (line) => line.includes('page.waitForTimeout('));
expect(
violations,
@@ -623,7 +623,7 @@ describe('E2E STOP rule — zero allowlist', () => {
).toEqual([]);
});
- test("no waitUntil: 'networkidle' in tests/{stress,visual,a11y}/*.e2e.ts (AC-4)", () => {
+ test("no waitUntil: 'networkidle' in tests/{stress,a11y}/*.e2e.ts (AC-4)", () => {
const violations = collectMatches(e2eFiles, (line) =>
/waitUntil:\s*['"]networkidle['"]/.test(line),
);
@@ -633,7 +633,7 @@ describe('E2E STOP rule — zero allowlist', () => {
).toEqual([]);
});
- test('no new Promise + setTimeout busy-wait in tests/{stress,visual,a11y}/*.e2e.ts (D-Q14)', () => {
+ test('no new Promise + setTimeout busy-wait in tests/{stress,a11y}/*.e2e.ts (D-Q14)', () => {
const pattern = /new Promise\(\s*(\w+)\s*=>\s*setTimeout\(\s*\1\s*,/;
const violations = collectMatches(e2eFiles, (line) => pattern.test(line));
expect(
@@ -642,7 +642,7 @@ describe('E2E STOP rule — zero allowlist', () => {
).toEqual([]);
});
- test('no page.pause( in tests/{stress,visual,a11y}/*.e2e.ts (D-Q14)', () => {
+ test('no page.pause( in tests/{stress,a11y}/*.e2e.ts (D-Q14)', () => {
const violations = collectMatches(e2eFiles, (line) => line.includes('page.pause('));
expect(
violations,
@@ -650,7 +650,7 @@ describe('E2E STOP rule — zero allowlist', () => {
).toEqual([]);
});
- test("no test.skip(browserName === 'webkit') in tests/{stress,visual,a11y}/*.e2e.ts (AC-5 ratchet)", () => {
+ test("no test.skip(browserName === 'webkit') in tests/{stress,a11y}/*.e2e.ts (AC-5 ratchet)", () => {
const pattern = /test\.skip\(\s*browserName\s*===\s*['"]webkit['"]/;
const violations = collectMatches(e2eFiles, (line) => pattern.test(line));
expect(
@@ -1419,7 +1419,7 @@ describe('E2E STOP rule — zero allowlist', () => {
).toEqual([]);
});
- test('no remote placeholder-image hosts in tests/{stress,visual,a11y} (PRD-8532)', () => {
+ test('no remote placeholder-image hosts in tests/{stress,a11y} (PRD-8532)', () => {
const violations = collectMatches(e2eTsFiles, isRemoteImageHost);
expect(
violations,
diff --git a/packages/app/tests/visual/component-parity.e2e.ts b/packages/app/tests/visual/component-parity.e2e.ts
deleted file mode 100644
index 3c116db2e..000000000
--- a/packages/app/tests/visual/component-parity.e2e.ts
+++ /dev/null
@@ -1,309 +0,0 @@
-/**
- * Visual regression suite for the 5-pack foundation, diffing each component against an approved
- * baseline at a 1% pixel tolerance across light and dark themes and selected and unselected
- * states. Per-worker fixture and per-test UUID docName, no hardcoded name (precedent #20(a)).
- */
-
-import { randomUUID } from 'node:crypto';
-import type { Page } from '@playwright/test';
-import { expect, test } from '../stress/_helpers';
-
-async function waitForProvider(page: Page) {
- await page.waitForFunction(() => Boolean(window.__activeProvider?.isSynced), {
- timeout: 15_000,
- });
-}
-
-async function waitForDocSeeded(page: Page, minChildCount = 1) {
- await page.waitForFunction(
- (n) => (window.__activeEditor?.state.doc.childCount ?? 0) >= n,
- minChildCount,
- { timeout: 10_000 },
- );
-}
-
-async function setTheme(page: Page, theme: 'dark' | 'light') {
- await page.evaluate((t) => {
- document.documentElement.classList.toggle('dark', t === 'dark');
- localStorage.setItem('ok-theme-v1', t);
- }, theme);
- await page.waitForFunction(
- (t) => document.documentElement.classList.contains('dark') === (t === 'dark'),
- theme,
- { timeout: 2000 },
- );
-}
-
-async function selectComponent(page: Page, componentName: string) {
- await page.evaluate((name) => {
- const editor = window.__activeEditor;
- if (!editor) throw new Error('no __activeEditor');
- let pos = -1;
- editor.state.doc.descendants(
- (node: { type: { name: string }; attrs: Record<string, unknown> }, p: number) => {
- if (pos === -1 && node.type.name === 'jsxComponent' && node.attrs.componentName === name) {
- pos = p;
- return false;
- }
- return pos === -1;
- },
- );
- if (pos === -1) throw new Error(`no jsxComponent named ${name}`);
- editor.chain().focus().setNodeSelection(pos).run();
- }, componentName);
- await expect(
- page
- .locator(`[data-jsx-component][data-component-name="${componentName}"][data-selected="true"]`)
- .first(),
- ).toBeVisible({ timeout: 5_000 });
-}
-
-async function deselectAll(page: Page) {
- await page
- .locator('.ProseMirror:not(.composer-prosemirror)')
- .click({ position: { x: 10, y: 10 } });
- await page.waitForFunction(
- () => !document.querySelector('[data-jsx-component][data-selected="true"]'),
- null,
- { timeout: 2_000 },
- );
-}
-
-async function seedAndNavigate(
- page: Page,
- api: { seedDocs: (d: Array<{ name: string; markdown: string }>) => Promise<void> },
- markdown: string,
-): Promise<string> {
- const docName = `vr-${randomUUID().slice(0, 12)}`;
- await api.seedDocs([{ name: docName, markdown }]);
- await page.goto(`/#/${docName}`);
- await waitForProvider(page);
- await page.waitForSelector('.ProseMirror:not(.composer-prosemirror)');
- return docName;
-}
-
-const calloutTypes = ['note', 'tip', 'important', 'warning', 'caution'] as const;
-
-for (const calloutType of calloutTypes) {
- for (const theme of ['light', 'dark'] as const) {
- test(`VR01-${calloutType}-${theme}: Callout type=${calloutType} in ${theme} mode`, async ({
- page,
- api,
- }) => {
- await seedAndNavigate(
- page,
- api,
- `<Callout type="${calloutType}">\n\nThis is a ${calloutType} callout with **bold** and *italic* text.\n\n</Callout>`,
- );
- await waitForDocSeeded(page);
- await setTheme(page, theme);
- await deselectAll(page);
-
- const component = page.locator('[data-jsx-component]').first();
- await expect(component).toHaveScreenshot(`callout-${calloutType}-${theme}-unselected.png`, {
- maxDiffPixelRatio: 0.01,
- });
-
- await selectComponent(page, 'Callout');
- await expect(component).toHaveScreenshot(`callout-${calloutType}-${theme}-selected.png`, {
- maxDiffPixelRatio: 0.01,
- });
- });
- }
-}
-
-for (const defaultOpen of [true, false] as const) {
- for (const theme of ['light', 'dark'] as const) {
- const label = defaultOpen ? 'open' : 'closed';
- test(`VR01-foldable-${label}-${theme}: Callout collapsible defaultOpen=${defaultOpen}`, async ({
- page,
- api,
- }) => {
- const attrs = defaultOpen
- ? 'type="warning" title="Heads up" collapsible defaultOpen'
- : 'type="warning" title="Heads up" collapsible';
- await seedAndNavigate(
- page,
- api,
- `<Callout ${attrs}>\n\nFoldable Callout body text.\n\n</Callout>`,
- );
- await waitForDocSeeded(page);
- await setTheme(page, theme);
- await deselectAll(page);
- const component = page.locator('[data-jsx-component]').first();
- await expect(component).toHaveScreenshot(`callout-foldable-${label}-${theme}.png`, {
- maxDiffPixelRatio: 0.01,
- });
- });
- }
-}
-
-for (const theme of ['light', 'dark'] as const) {
- test(`VR-IMAGE-${theme}: <img> with always-on zoom in ${theme} mode`, async ({ page, api }) => {
- await seedAndNavigate(
- page,
- api,
- '<img src="/placeholder.png" alt="Placeholder" width={400} />',
- );
- await waitForDocSeeded(page);
- await setTheme(page, theme);
- await deselectAll(page);
- const component = page.locator('[data-jsx-component]').first();
- await expect(component).toHaveScreenshot(`image-${theme}-unselected.png`, {
- maxDiffPixelRatio: 0.02,
- });
- });
-}
-
-for (const theme of ['light', 'dark'] as const) {
- test(`VR-VIDEO-${theme}: Video with poster in ${theme} mode`, async ({ page, api }) => {
- await seedAndNavigate(page, api, '<video src="/sample.mp4" poster="/placeholder.png" />');
- await waitForDocSeeded(page);
- await setTheme(page, theme);
- await deselectAll(page);
- const component = page.locator('[data-jsx-component]').first();
- await expect(component).toHaveScreenshot(`video-${theme}-unselected.png`, {
- maxDiffPixelRatio: 0.02,
- });
- });
-}
-
-for (const theme of ['light', 'dark'] as const) {
- test(`VR-AUDIO-${theme}: Audio native chrome in ${theme} mode`, async ({ page, api }) => {
- await seedAndNavigate(page, api, '<audio src="/sample.mp3" />');
- await waitForDocSeeded(page);
- await setTheme(page, theme);
- await deselectAll(page);
- const component = page.locator('[data-jsx-component]').first();
- await expect(component).toHaveScreenshot(`audio-${theme}-unselected.png`, {
- maxDiffPixelRatio: 0.02,
- });
- });
-}
-
-for (const theme of ['light', 'dark'] as const) {
- test(`VR-ACCORDION-${theme}: Accordion expanded (defaultOpen) in ${theme} mode`, async ({
- page,
- api,
- }) => {
- await seedAndNavigate(
- page,
- api,
- '<Accordion title="Expanded accordion" defaultOpen>\n\nBody content\n\n</Accordion>',
- );
- await waitForDocSeeded(page);
- await setTheme(page, theme);
- await deselectAll(page);
- const component = page.locator('[data-jsx-component]').first();
- await expect(component).toHaveScreenshot(`accordion-expanded-${theme}.png`, {
- maxDiffPixelRatio: 0.01,
- });
- });
-
- test(`VR-ACCORDION-collapsed-${theme}: Accordion collapsed in ${theme} mode`, async ({
- page,
- api,
- }) => {
- await seedAndNavigate(
- page,
- api,
- '<Accordion title="Collapsed accordion">\n\nHidden body\n\n</Accordion>',
- );
- await waitForDocSeeded(page);
- await setTheme(page, theme);
- await deselectAll(page);
- const component = page.locator('[data-jsx-component]').first();
- await expect(component).toHaveScreenshot(`accordion-collapsed-${theme}.png`, {
- maxDiffPixelRatio: 0.01,
- });
- });
-
- test(`VR-ACCORDION-exclusive-grouping-${theme}: HTML5 <details name> grouping in ${theme} mode`, async ({
- page,
- api,
- }) => {
- await seedAndNavigate(
- page,
- api,
- [
- '<Accordion title="First" name="grp" defaultOpen>',
- '',
- 'First body',
- '',
- '</Accordion>',
- '',
- '<Accordion title="Second" name="grp">',
- '',
- 'Second body',
- '',
- '</Accordion>',
- ].join('\n'),
- );
- await waitForDocSeeded(page, 2);
- await setTheme(page, theme);
- await deselectAll(page);
- await expect(page.locator('.ProseMirror:not(.composer-prosemirror)')).toHaveScreenshot(
- `accordion-exclusive-grouping-${theme}.png`,
- { maxDiffPixelRatio: 0.02 },
- );
- });
-}
-
-for (const theme of ['light', 'dark'] as const) {
- test(`VR17-${theme}: Mixed 5-pack document in ${theme} mode`, async ({ page, api }) => {
- await seedAndNavigate(
- page,
- api,
- [
- '# Mixed 5-Pack Components',
- '',
- '<Callout type="warning">',
- '',
- 'Watch out!',
- '',
- '</Callout>',
- '',
- '<img src="/placeholder.png" alt="Diagram" />',
- '',
- '<Accordion title="Advanced" defaultOpen>',
- '',
- '<Callout type="tip">',
- '',
- 'Nested tip',
- '',
- '</Callout>',
- '',
- '</Accordion>',
- '',
- '<video src="/sample.mp4" />',
- '',
- '<audio src="/sample.mp3" />',
- ].join('\n'),
- );
- await waitForDocSeeded(page, 6);
- await setTheme(page, theme);
-
- await expect(page.locator('.ProseMirror:not(.composer-prosemirror)')).toHaveScreenshot(
- `mixed-document-${theme}.png`,
- {
- maxDiffPixelRatio: 0.02,
- },
- );
- });
-}
-
-for (const theme of ['light', 'dark'] as const) {
- test(`VR18-${theme}: Wildcard unregistered component in ${theme} mode`, async ({ page, api }) => {
- await seedAndNavigate(
- page,
- api,
- '<CustomThing prop="value">\n\nUnregistered component content\n\n</CustomThing>',
- );
- await waitForDocSeeded(page);
- await setTheme(page, theme);
- const component = page.locator('[data-jsx-component]').first();
- await expect(component).toHaveScreenshot(`wildcard-unregistered-${theme}.png`, {
- maxDiffPixelRatio: 0.01,
- });
- });
-}