diff --git a/apps/docs/src/lib/components-index-generator.test.ts b/apps/docs/src/lib/components-index-generator.test.ts index ea4aa461..2267f2fc 100644 --- a/apps/docs/src/lib/components-index-generator.test.ts +++ b/apps/docs/src/lib/components-index-generator.test.ts @@ -19,13 +19,6 @@ test('groups every entry by category in sidebar order', () => { test('emits the generated file on disk that the docs app imports', () => { const emitted = generateComponentsIndex(); - - for (const group of componentIndexGroups) { - for (const entry of group.entries) { - expect(emitted).toContain(`url: '${entry.url}'`); - } - } - const emittedPath = resolve(import.meta.dirname, '../generated/components-index.generated.ts'); expect(readFileSync(emittedPath, 'utf8')).toBe(emitted); }); diff --git a/apps/docs/src/lib/token-reference-generator.test.ts b/apps/docs/src/lib/token-reference-generator.test.ts index f0f97b7d..d516b718 100644 --- a/apps/docs/src/lib/token-reference-generator.test.ts +++ b/apps/docs/src/lib/token-reference-generator.test.ts @@ -1,3 +1,5 @@ +import { readFileSync } from 'node:fs'; +import { resolve } from 'node:path'; import { expect, test } from 'vite-plus/test'; import { generateTokenReference } from '../../scripts/generate-token-reference.js'; import { themeTokens } from '../generated/token-reference.generated.js'; @@ -20,9 +22,6 @@ test('declares the family union the token entries are keyed by', () => { test('emits the generated file on disk that the docs app imports', () => { const emitted = generateTokenReference(); - - for (const token of themeTokens) { - expect(emitted).toContain(`path: '${token.path}'`); - } - expect(themeTokens.length).toBe(emitted.match(/\bvariable: '--luke-/g)?.length); + const emittedPath = resolve(import.meta.dirname, '../generated/token-reference.generated.ts'); + expect(readFileSync(emittedPath, 'utf8')).toBe(emitted); }); diff --git a/packages/@luke-ui/react/src/checkbox/checkbox.browser.test.tsx b/packages/@luke-ui/react/src/checkbox/checkbox.browser.test.tsx index 99cec955..c3847ad2 100644 --- a/packages/@luke-ui/react/src/checkbox/checkbox.browser.test.tsx +++ b/packages/@luke-ui/react/src/checkbox/checkbox.browser.test.tsx @@ -6,12 +6,6 @@ import { Checkbox } from './index.js'; testFieldShapedConformance({ path: 'checkbox', - assertAssociation: (result) => { - // oxlint-disable-next-line vitest/no-standalone-expect - expect(result.locator.getByRole('checkbox', { name: 'Terms' }).element()).toHaveAccessibleName( - 'Terms', - ); - }, getControl: (result) => { const control = result.locator.getByRole('checkbox', { name: 'Terms' }).element(); if (!(control instanceof HTMLElement)) throw new Error('Expected a checkbox control.'); diff --git a/packages/@luke-ui/react/src/conformance/manifest.test.ts b/packages/@luke-ui/react/src/conformance/manifest.test.ts index ec889940..9e07b1e7 100644 --- a/packages/@luke-ui/react/src/conformance/manifest.test.ts +++ b/packages/@luke-ui/react/src/conformance/manifest.test.ts @@ -126,14 +126,6 @@ test('covers every public component entrypoint exactly once', () => { } }); -test('declares every conformance dimension explicitly', () => { - for (const entry of componentTestManifest) { - expect(entry.conformanceTier).toBeTypeOf('string'); - expect(entry.integrationTripwire).toBeTypeOf('string'); - expect(entry.visualApplicability).toBeTypeOf('string'); - } -}); - test('browser tests invoke the helpers required by their manifest entry', () => { expect( getBrowserCoverageErrors(componentTestManifest, (path) => { diff --git a/packages/@luke-ui/react/src/theme/build-theme.test.ts b/packages/@luke-ui/react/src/theme/build-theme.test.ts index fe442b4c..c85b5657 100644 --- a/packages/@luke-ui/react/src/theme/build-theme.test.ts +++ b/packages/@luke-ui/react/src/theme/build-theme.test.ts @@ -187,17 +187,6 @@ describe('compileTheme interaction source', () => { describe('bundled themes meet WCAG 2.2 AA', () => { for (const foundation of [tactileFoundation, paperFoundation]) { - // `validateContrast` in contrast-validation.ts already hard-gates text-vs-surface contrast - // (>=4.5:1, every surface) and border.control-vs-surface contrast (>=3:1, canvas and - // recessed) for every mode, throwing `ThemeContrastError` on any miss (exercised directly in - // `contrast-validation.test.ts`). Recomputing those exact ratios from the emitted CSS here can - // never fail: if either gate had missed, `buildTheme` would already have thrown before this - // assertion ran. The honest statement of the same property is that building the bundled theme - // does not throw. - it(`${foundation.name} compiles without a WCAG hard-gate failure`, () => { - expect(() => buildTheme(foundation)).not.toThrow(); - }); - it(`${foundation.name} keeps light canvas neutral, recessed surfaces white, and dark wells distinct`, () => { const blocks = splitBlocks(buildTheme(foundation)); const lightCanvas = parseColor(extractValue(blocks.baseLight, '--luke-color-surface-canvas')); @@ -257,12 +246,6 @@ describe('bundled themes meet WCAG 2.2 AA', () => { } }); -// The loading-skeleton contrast gate lives in `loading-skeleton.browser.test.ts` ("keeps the -// pulse's dimmest frame perceptible against every bundled theme's canvas"), which samples the real -// animated pulse and requires >=1.4:1 at both its brightest and dimmest frame. That subsumes and is -// stricter than a static "skeleton !== canvas and contrastRatio > 1" check would ever be — the -// latter is a tautology once the two colours are already known to differ, so it added no coverage. - describe('buildTheme public motion surface', () => { // The numbered duration scale in `motion.ts` is private in the same sense as the 12-step colour // scale: resolved in TypeScript and never published as a custom property. Only the three diff --git a/packages/@luke-ui/react/src/theme/contract.test.ts b/packages/@luke-ui/react/src/theme/contract.test.ts index 1b34428d..8b58c7d0 100644 --- a/packages/@luke-ui/react/src/theme/contract.test.ts +++ b/packages/@luke-ui/react/src/theme/contract.test.ts @@ -119,20 +119,6 @@ describe('theme contract', () => { expect(Object.hasOwn(vars.color, 'scrim')).toBe(false); }); - it('defines the selected spacing steps from the 4px scale', () => { - expect(spaceScale).toEqual([ - ['100', '4px'], - ['200', '8px'], - ['300', '12px'], - ['400', '16px'], - ['600', '24px'], - ['800', '32px'], - ['1000', '40px'], - ['1200', '48px'], - ['1600', '64px'], - ]); - }); - it('derives the spacing contract keys from the spacing scale', () => { expect(Object.keys(themeContractTree.space)).toEqual(spaceScale.map(([step]) => step)); }); diff --git a/packages/@luke-ui/react/src/theme/define-theme.test.ts b/packages/@luke-ui/react/src/theme/define-theme.test.ts index c67c2647..d999fa16 100644 --- a/packages/@luke-ui/react/src/theme/define-theme.test.ts +++ b/packages/@luke-ui/react/src/theme/define-theme.test.ts @@ -36,24 +36,6 @@ function extractValue(block: string, varName: string): string { const ACCENT_SOLID = '--luke-color-background-accent-solid-rest'; -describe('defineTheme colour-only authoring', () => { - // `defineTheme` compiles through `buildTheme`, whose `validateContrast` already hard-gates - // text-vs-surface contrast (>=4.5:1, every surface) and border.control-vs-surface contrast - // (>=3:1, canvas and recessed) for every mode, throwing `ThemeContrastError` on any miss. - // Recomputing those exact ratios from the emitted CSS here can never fail: if either gate had - // missed, `defineTheme` would already have thrown before an assertion could run. The honest - // statement of the same property is that building from just an accent and a neutral character - // does not throw. - it('builds a theme from just an accent and a neutral character without a WCAG hard-gate failure', () => { - expect(() => { - return defineTheme({ - color: { accent: '#3b82f6', neutralStyle: 'cool' }, - name: 'colour-only', - }); - }).not.toThrow(); - }); -}); - describe('defineTheme single-value accent adaptation', () => { const accents = [ '#3b82f6', diff --git a/packages/@luke-ui/react/src/theme/scale.test.ts b/packages/@luke-ui/react/src/theme/scale.test.ts index 76681c27..f758c249 100644 --- a/packages/@luke-ui/react/src/theme/scale.test.ts +++ b/packages/@luke-ui/react/src/theme/scale.test.ts @@ -147,19 +147,6 @@ describe('on-solid contrast guarantee', () => { } } }); - - it('reports a satisfied on-solid anchor', () => { - const { diagnostics } = familyDiagnostics( - '#0090ff', - 'light', - 'accent', - interactionTarget('light'), - ); - expect(diagnostics.solidAnchor.satisfied).toBe(true); - expect(diagnostics.onSolid.ratioRest).toBeGreaterThanOrEqual(TEXT_RATIO); - expect(diagnostics.onSolid.ratioHover).toBeGreaterThanOrEqual(TEXT_RATIO); - expect(diagnostics.onSolid.ratioPressed).toBeGreaterThanOrEqual(TEXT_RATIO); - }); }); describe('reference-envelope properties', () => { diff --git a/packages/turbo-generators/src/component-creation-plan.test.ts b/packages/turbo-generators/src/component-creation-plan.test.ts index e018abf6..2eb284fa 100644 --- a/packages/turbo-generators/src/component-creation-plan.test.ts +++ b/packages/turbo-generators/src/component-creation-plan.test.ts @@ -116,13 +116,4 @@ describe('createComponentPlan', () => { const parsed = parseSync(testFile.path, testFile.contents, { lang: 'tsx' }); expect(parsed.errors).toEqual([]); }); - - it('does not import unused ComponentProps in the browser test', () => { - const plan = createComponentPlan(validAnswers); - - const testFile = plan.files.find((file) => file.path.endsWith('.browser.test.tsx')); - if (testFile === undefined) throw new Error('Expected the scaffold to write a browser test.'); - - expect(testFile.contents).not.toContain('ComponentProps'); - }); });