fix: three-layer test architecture and the defects it surfaced#728
Open
robsongajunior wants to merge 44 commits into
Open
fix: three-layer test architecture and the defects it surfaced#728robsongajunior wants to merge 44 commits into
robsongajunior wants to merge 44 commits into
Conversation
Vitest browser mode (Playwright Chromium) + @testing-library/vue + composeStories, axe-core a11y helper, theme CSS loaded in setup so contrast checks are real, publish-safe files negation (no test files in the tarball), sharded CI workflow, and root passthrough scripts. Adopts the direction validated by the #704 proposal; hardens the gaps (publish leak, unstyled-DOM a11y, pure-module coverage, CI scale).
…onfig Functional Button coverage (polymorphism, click emission, disabled/loading click-suppression, aria-busy/disabled, spinner, axe a11y) plus composeStories fixtures. Config: define process.env.NODE_ENV for @testing-library/vue in the browser, CI retry, drop the unusable @stories alias (tests use relative story paths so validate-references resolves them). Removes the bootstrap smoke test.
…onents Wave 1 — browser-mode (Chromium) functional coverage authored + self-verified per component: actions (button-highlight, mini-button, copy-button, segmented-button, icon-button), content (badge, card-box, card-pricing, currency, avatar, tag, overline), feedback (message, empty-state, status-indicator, skeleton, progress-bar, empty-results-block), inputs (label, helper-text, chip), layout (divider), navigation (link), utils (spinner). Each asserts rendering, emitted events with payloads, disabled/loading suppression, ARIA, and axe a11y; composeStories where a story exists. 419 tests green across 25 files. gitignore browser screenshots.
…ple components Wave 2 — browser-mode functional coverage: inputs (input-text, input-number, input-password, textarea, field-text, field-password, field-textarea, checkbox, radio-button, switch, field-checkbox(-block), field-radio(-block), field-switch(-block), box-grid-selection), data (code-block), navigation (menu-item, breadcrumb-item), layout (sidebar + group/header/footer). Each covers v-model round-trip, emitted events, disabled/readonly suppression, ARIA, and axe; composeStories where a story exists.
…ay & recursive components Wave 3 — browser-mode functional coverage for the hard components: composition (item, table, paginator, flow, pick-list, log-view, toast, select, multi-select, dropdown, tab-view, global-header, breadcrumb) and overlays/recursive (dialog, drawer, panel, tooltip, navigation-menu) plus calendar. Covers compound dot-notation, provide/inject shared state, emitted events, v-model, open/close + Escape + focus-trap + Teleport for overlays, nested-instance context for recursive menus, and axe a11y. One breadcrumb overflow-select test is skipped with a documented reason. Adds DOM globals (SVGElement, requestAnimationFrame, HTMLOptionElement) to eslint config for the test files.
…ig vitest axe i11y
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
…defined' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
…defined' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
…defined' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
…defined' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
…defined' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The webkit testing initiative: a three-layer test architecture for
@aziontech/webkit(functional browser-mode suite, Storybook visual regression, one ordered CI pipeline), plus the component and packaging defects the new suites surfaced. 36 commits.Layer 1 — Functional suite (Vitest browser mode)
@vitest/browser-playwrightrunning every test in real headless Chromium — behavior, structure, and ARIA on a real DOM, not jsdom.popover,accordion,split-button,scroll-area,input-group,field-input-group,field-phone-number,field-text-switch. Thetemplates/components are intentionally untested — the folder is slated for deletion.vitest.config.ts— browser mode, CI retry, v8 coverage config (report-only for now)src/test/setup.ts— anchor-navigation guard (real<a href>clicks would tear down the test iframe) + per-test cleanupsrc/test/axe.ts— axe-core structural a11y helper; every suite asserts zero violations (visual rules like color-contrast are disabled because this env doesn't run Tailwind — pixels belong to Layer 2)dev: the standardized stories tree (per-component folders, renamed exports) and the breaking event refactor — suites now assert the positional(event, item)payloads ofdropdownselect,split-buttonitem-click,breadcrumbnavigate,pick-listitem-double-click andtablerow-click, including the originatingMouseEvent/KeyboardEvent..claude/rules/testing.mdand enforced by a newenforce-test-exists.mjshook; the component-scaffold skill now emits a test file.Real component defects documented via
it.skip(verified red, not faked green)Dropdown.Trigger(role="button"span) wraps the real IconButton<button>→ axenested-interactive(split-button.vue:141).aria-requiredis set on therole="group"root, where it is not an allowed ARIA attribute → axearia-allowed-attr.role="combobox") has no accessible name: thearia-labellands on the Select wrapper div (field-phone-number.vue:143). Blocks two axe assertions (same root cause).<SelectTrigger>slot content, butselect-trigger.vuehas no default slot → the trigger shows the raw ISO code ("BR" instead of "+55") (field-phone-number.vue:146).navigateemit under synthetic interaction; needs a component-level check.Layer 2 — Visual regression (Storybook test-runner)
@storybook/test-runner+jest-image-snapshot: every story (75 files / 309 snapshots) screenshotted at#storybook-root(1280×720, fonts ready, animations at 1ms via thevisual-test-freezestyle, pointer parked) and compared against committed baselines with a 0.01% threshold.parameters.layoutgeometry. Baselines are platform-specific:linux/is the CI contract;darwin/supports local runs and stays gitignored.test-runner-jest.config.js→testPathIgnorePatterns): thestories/templates/files are never collected — no render smoke, no snapshot, no baseline on-u. Their orphan baselines were removed.playwrightpinned to^1.61.1in bothpackages/webkitandapps/storybook, so the CLI that installs Chromium in CI is the same version the runners use.test:visual/test:visual:static/test:visual:ci/test:visual:updatein the storybook app; at the root,storybook:test:visual*plusstorybook:test:visual:update:baseline(dispatches the regeneration workflow).Layer 3 — CI: one ordered pipeline, no loose checks
governance.ymlnow carries the whole chain:changes → security ∥ lint ∥ types → build ∥ storybook ∥ tests → visual → Governance Gatetests— the Vitest browser suite, sharded 4×, gated on lint + types (stories are unit fixtures, soapps/storybookchanges retrigger it).visual— last link: builds Storybook and runstest:visual:ciagainst the committed baselines only after everything upstream is green; uploads__diff_output__on failure.testsandvisual; cleanly-skipped jobs still pass (path-filtered).package-webkit-test.ymlremoved — its shard matrix moved into governance, so the suite no longer double-runs per PR.app-storybook-generate-baseline.yml— dispatch-only baseline tool: run withupdate_baselines=true, download thevisual-baselines-linuxartifact, commit its contents.Defects surfaced and fixed by the suites
IconButtoninsideDropdown.Trigger(itselfrole="button") — an axenested-interactiveviolation. The Trigger now carries the icon and styling directly.show-apply=falseimmediate mode, presets, keyboard grid navigation, clearable, axe).empty-results-block.test.tsremoved.Packaging / publish hygiene
filesnegations (!src/**/*.test.{ts,js},!src/test/**) plus apack:checkguard script that fails if a test file leaks intonpm pack.pnpm-workspace.yaml:@swc/corepostinstall disabled (the native binary ships via the platform optionalDep; the script is only a download fallback).@aziontech/webkitdirectly — the@aziontech/webkit.devVite alias is gone (follow-up to the [NO-ISSUE] fix: resolve prettier format and vue-tsc type-check CI failures #726 package rename). Deadwebkit-v3ref and unused root deps removed.How to run
Verification
vue-tsc --noEmit, ESLint (--max-warnings 0), and prettier all clean