Repository navigation
test: make the test:ci log clean and fail on unexpected console output - #3322
Merged
Merged
Conversation
interactivellama
force-pushed
the
chore/clean-ci-warnings
branch
3 times, most recently
from
November 17, 2026 17:47
e965d09 to
61c3e3e
Compare
interactivellama
changed the base branch from
master
to
feat/v11-rc-breaking
November 17, 2026 17:48
interactivellama
force-pushed
the
chore/clean-ci-warnings
branch
from
November 17, 2026 22:45
61c3e3e to
d1e5214
Compare
interactivellama
changed the base branch from
feat/v11-rc-breaking
to
feat/v11-asks-1-release-policy
November 17, 2026 23:49
interactivellama
changed the base branch from
feat/v11-asks-1-release-policy
to
feat/block-private-exports
November 17, 2026 23:50
interactivellama
changed the base branch from
feat/block-private-exports
to
feat/v11-rc-breaking
November 18, 2026 00:06
interactivellama
force-pushed
the
chore/clean-ci-warnings
branch
from
November 18, 2026 23:06
d1e5214 to
206cbdd
Compare
interactivellama
added a commit
that referenced
this pull request
Nov 18, 2026
no-style-elements mounts every story, which replays their deprecation and Modal app-element warnings, and the tooltip browser test passed its trigger as the deprecated children. The console guard from #3322 counts both. Mock console in the story sweep, restoring it after cleanup since unmounting a Modal warns too, and pass the tooltip trigger through trigger.
interactivellama
added a commit
that referenced
this pull request
Nov 20, 2026
no-style-elements mounts every story, which replays their deprecation and Modal app-element warnings, and the tooltip browser test passed its trigger as the deprecated children. The console guard from #3322 counts both. Mock console in the story sweep, restoring it after cleanup since unmounting a Modal warns too, and pass the tooltip trigger through trigger.
Niznikr
approved these changes
Nov 20, 2026
interactivellama
force-pushed
the
chore/clean-ci-warnings
branch
from
November 20, 2026 23:37
508cfc5 to
b406dee
Compare
`build.lib.formats` duplicated the `rollupOptions.output` array, so Vite ignored it and warned on every build. The emitted dist/ files are byte-identical without it. `jsxBracketSameLine` was removed in Prettier 3.
Fixtures rendered controlled components (ColorPicker, DatePicker, Slider, ButtonStateful, Tree, Checkbox, SimpleDataTable) without their required change handler, so every render logged an "is required by" error. Input and ColorPicker fixtures also passed both label and assistiveText.label. Fixtures now pass a no-op handler. Tests that cover the missing-handler or both-labels path keep that input and silence the expected error with a spy.
General tests used APIs deprecated in v11 (ProgressIndicator completedSteps and errorSteps, Tooltip children as trigger, Tree onClick/onExpandClick and node.selected, Radio onRenderVisualPicker), so they logged deprecation warnings that hid real ones. They now use the replacement APIs. Tests that exercise a deprecated path on purpose (Combobox inline-listbox multiple and action item onClick, Checkbox onRequestFocus, the ProgressIndicator arrays) keep it and silence or assert the warning with a spy. Removal tests for defaultValue and singleInputDisabled restored their spy before the follow-up render, which warned again from the component's fresh check-props instance; the spy now covers that render. No props are removed: these were all deprecated in v11 and stay through 11.x.
ProgressIndicator path tests focused and clicked stages outside act(); the focus handler moves the roving tab stop, a state update, so React warned. They now run inside act(). Carousel and VerticalNavigation click tests clicked real links without preventing the default action, which jsdom cannot perform and reports as "navigation to another Document" being unimplemented. Their handlers now call preventDefault, as the neighbouring tests already do.
Root cause: `ButtonProps.responsive` was declared but never destructured, so it reached `<button>` through `restProps` and React warned about a non-boolean attribute. 0.10.x declared the prop and never applied it. ButtonStateful mapped it to `slds-max-small-button_stretch`, a class SLDS does not have, so it had no effect there either. Both now map `responsive` to `slds-button_stretch`, SLDS's full-width button class. SLDS has no small-screen-only variant, so the button stretches at every width. The examples' page-header title triggers passed `responsive` while it did nothing; they drop it so they keep their width.
Root cause: Button always defaulted `type` to `button`, and browsers ignore `formAction` on a `type="button"` button, so a Button given `formAction` without an explicit `type` did nothing on click and React warned. When `formAction` is set and `type` is not, `type` now defaults to `submit`. An explicit `type` still wins, and without `formAction` the default stays `button`. Behaviour change for consumers: a Button with `formAction` and no `type` now submits its form, as `formAction` implies.
Root cause: `SimpleDataTableInteractiveElement` injected `onOpen` and
`onClose` into every element it wrapped, though only MenuDropdown uses them
(to pause table keyboard navigation while its menu is open). Button passes
its native attributes through to `<button>`, so a wrapped Button rendered
them and React warned about an unknown `onOpen` event handler.
The wrapper now injects them only into MenuDropdown, or into an element
wrapped with the new `{ tracksOpen: true }` option, for a consumer's own
popover. Button is unchanged.
Drops unused variables, parameters and imports, removes initial values that were always overwritten (no-useless-assignment), removes console.log calls from test handlers, and associates the Panel story's labels with their selects. Also deletes the unused `handleClickOutside` callbacks in Combobox and Popover; click-outside is handled by Dialog. No behaviour change. The Panel story snapshot gains the label `for` and select `id`.
Behaviour fixes: - tree: branch treeitems now set aria-selected, as leaf items already did. Branches were announced with no selection state. - simple-data-table: the row's memoized cells depend on tableContext.isGrid, so the select cell's gridcell role follows keyboardNavigation instead of keeping the role from the first render. - pill-container: the reset effect lists resetActiveSelectedOption, which is defined before it. - filter: handleChange lists setPopoverIsOpen (a stable setter). Accepted with a reason: the mount-only check-props and app-element checks in modal and tooltip, and the src jsx-a11y sites whose markup follows SLDS (anchors as tabs, options and heading links; click handlers whose keyboard path lives on the focusable element or the listbox). Each disable names its reason. Lint-only cleanups: the unused combobox wrapper ref and its no-op click-outside hook (the menu closes on input blur; popover handles its own click-outside), the combobox non-null assertion, and the empty SimpleDataTableSelection interface. Docs and examples: placeholder href="#" anchors get fragment targets. Story snapshots updated.
Lint is at 35 warnings, all from the React Compiler rule set (react-hooks/refs and set-state-in-effect). They are carried past 11.0 GA. The lint script now fails above 35, so the count can only go down. Recorded in ROADMAP.md.
These four files predate the prettier config and still used spaces. The next two commits touch them, and lint-staged reformats a whole file when it is staged, so format them on their own first to keep those diffs readable.
Every warn-once helper in utilities/warning, plus the ColorPicker and DatePicker missing-value checks, now keeps its warned keys in a map from warned-registry. resetWarnings() clears them all, and both Vitest setup files call it after each test. In an app nothing calls it, so each message still prints once per page load. Tests no longer need vi.resetModules() and a dynamic import to see a warning. Two tests that only passed because an earlier test had used the warn-once slot now assert what they meant: the checkbox test looks for React's controlled/uncontrolled message only, and the progress indicator test compares call counts across the re-render.
vitest.console-guard.ts, loaded by both setup files, fails any test that writes to console.error or console.warn. A test that expects a warning spies on the console itself, which bypasses the guard. console.log is not guarded. The guard caught one more source: the combobox renderMenuItem tests open the menu at mount, and floating-ui's async positioning updated SLDSDialog after the test ended (an act warning). They now use menuPosition="relative", as the other open-state tests do. `vite build` now fails on any warning: Vite's own warnings through a throwing logger (build command only, so dev and Storybook keep the default), and bundler warnings through onwarn.
Storybook's react-docgen-typescript plugin parses every *.tsx file except stories. The Tree docs' sample data, __docs__/dynamic-hashmap.tsx, is outside the TypeScript project (tsconfig excludes __docs__), so the plugin warned that it was skipping it. Since the build now fails on any warning, storybook build stopped there. The file has no JSX, so it is now dynamic-hashmap.ts, which docgen does not parse.
Root cause: `build-storybook` loads vite.config.ts with `command: 'build'`, so the warning-to-error logger from 27b8582 also applied to Storybook. On the Chromatic runner, Rolldown's PLUGIN_TIMINGS hint ("Your build spent 79% ... inside plugin hooks") is logged through that logger and failed the build. The hint depends on runner speed, which is why it doesn't reproduce locally. Use the throwing logger only when Storybook is not the caller (Storybook sets STORYBOOK=true before loading the config). Also turn off `checks.pluginTimings` for the library build, so a slow CI machine can't fail it with the same hint.
Root cause: four warn-once helpers set their flag to a value unrelated to whether they warned. - `is-trigger-tabbable` set it to `false`, so the warning repeated on every render. - `if-one-then-both-required-property`, `only-one-of-properties` and `one-of-required-property` set it to `!!selectedProps`, which is always true. A valid first render used up the warning, so a later invalid one never warned. Each now sets the flag from its own check, as `required-property` does.
Vite and Rollup warnings are printed again instead of thrown. Failing the build on any warning made `npm run build`, and Storybook through the shared config, depend on warnings outside the repo's control: Rolldown's PLUGIN_TIMINGS hint failed Chromatic on a slow runner. This reverts the throwing logger and `onwarn` from 27b8582 and the Storybook carve-out from the previous commit. The redundant `lib.formats` stays removed, so the build is still warning-free today.
Tests: the console guard now records unexpected console.error and console.warn output on each test instead of throwing. A new Vitest reporter (scripts/vitest-console-reporter.ts) lists it after every run and, on GitHub Actions, annotates each test file and adds a table to the job summary. The run fails once the total is over `maxWarnings`, which starts at 0, so today's behaviour is unchanged. Lint: a formatter (scripts/eslint-github-formatter.cjs) keeps the stylish output and, on GitHub Actions, annotates each problem on its line and lists them all in the job summary, since GitHub shows only the first 10 annotations per step. `--max-warnings=35` still decides failure.
React Compiler rules report the same location once per use of the value, so one ColorPicker line produced 9 identical annotations and filled GitHub's 10 visible annotations. Annotate each location and rule once, with a count. The job summary still lists every problem, and --max-warnings still counts them.
interactivellama
force-pushed
the
chore/clean-ci-warnings
branch
from
November 20, 2026 23:43
b406dee to
70179e5
Compare
4 of 15 tasks
interactivellama
added a commit
that referenced
this pull request
Nov 23, 2026
no-style-elements mounts every story, which replays their deprecation and Modal app-element warnings, and the tooltip browser test passed its trigger as the deprecated children. The console guard from #3322 counts both. Mock console in the story sweep, restoring it after cleanup since unmounting a Modal warns too, and pass the tooltip trigger through trigger.
interactivellama
added a commit
that referenced
this pull request
Nov 23, 2026
no-style-elements mounts every story, which replays their deprecation and Modal app-element warnings, and the tooltip browser test passed its trigger as the deprecated children. The console guard from #3322 counts both. Mock console in the story sweep, restoring it after cleanup since unmounting a Modal warns too, and pass the tooltip trigger through trigger.
interactivellama
added a commit
that referenced
this pull request
Nov 24, 2026
no-style-elements mounts every story, which replays their deprecation and Modal app-element warnings, and the tooltip browser test passed its trigger as the deprecated children. The console guard from #3322 counts both. Mock console in the story sweep, restoring it after cleanup since unmounting a Modal warns too, and pass the tooltip trigger through trigger.
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.
Part of the v11 merge train, stack 1 "clean CI": ci-warnings → react-hooks-refs → deprecated-dom-apis → deprecated-prop lint (#3311) → private exports. It merges first, so later stacks rebase onto a clean log.
Additional description
This makes
npm run test:ciprint a clean log, and keeps it clean.Root cause: most of the test noise came from fixtures, not components. The
utilities/warning/*helpers warn once per module, which hid how many there were: CI showed 27 stderr blocks, but there were 289console.errorcalls with warn-once defeated.onChange,onRowChange,onClick,onSelect, …).act/jsdom-navigation noise and three real component bugs.Changes:
vi.spyOn(console, 'error'); the act and jsdom navigation noise is fixed. A test-only reset clears the warn-once state between tests.ButtonandButtonStateful:responsivenow addsslds-button_stretch. On Button the prop did nothing and leaked to the DOM as an attribute; ButtonStateful usedslds-max-small-button_stretch, which SLDS doesn't have. SLDS has no small-screen-only stretch class, so the button is full width at every screen size. The page-header title triggers in the split-view and Simple Data Table examples passedresponsivewhile it did nothing, so they drop it and keep their width.ButtondefaultstypetosubmitwhenformActionis set (React rejectsformActionontype="button").SimpleDataTableInteractiveElementpassesonOpen/onCloseonly to elements that open a popover. It injected them into every wrapped element, though only MenuDropdown uses them (to pause table keyboard navigation while its menu is open), so a wrapped Button renderedonOpenon the DOM. MenuDropdown still gets them automatically. A consumer's own popover opts in with the new optionSimpleDataTableInteractiveElement(MyPopover, { tracksOpen: true })(typeSimpleDataTableInteractiveElementOptions). Button and Checkbox no longer receive them.lib.formats, which printed a Vite warning, and the deadjsxBracketSameLineprettier option.exhaustive-depsfindings. The remaining 35 (react-hooks/refsandset-state-in-effect) are capped with--max-warnings. The next PR fixes them and removes the cap.vitest.console-guard.tsrecords any unexpectedconsole.error/console.warn.scripts/vitest-console-reporter.tslists them after the run and, on GitHub Actions, annotates each test file and writes them to the job summary. The run fails pastmaxWarnings(0).scripts/eslint-github-formatter.cjsannotates each warning location once (with a count when ESLint repeats it) and lists every warning in the job summary.This PR has no breaking API changes. None of the deprecations that fired were removed; they all stay deprecated through 11.x. Two behaviour changes for consumers:
responsiveon Button and ButtonStateful now makes the button full width, and Button defaultstypetosubmitwhenformActionis set without atype.CONTRIBUTOR checklist (do not remove)
Please complete for every pull request.
Green gate — all of these must pass locally (CI runs the same):
npm run lintpasses with 0 errors (npm run lint:fixto auto-fix). Warnings are the tracked gradual-migration backlog; do not add new errors.npm run typecheckis clean (tsc --noEmit).npm test -- --runpasses — this runs both Vitest projects (jsdomunit+ real-browserbrowser) and the story HTML snapshots. If you changed rendered markup on purpose, update snapshots withnpm test -- --run -uand review the diff.npm run buildsucceeds (type-check + Vite library build +.d.ts+ entry shims).Behavior & docs:
components/button/__tests__). New props and bug fixes should get a regression test. Tests that genuinely need a real browser (focus traversal, layout/measurement, canvas) go in a*.browser.test.jsxfile (thebrowserproject); everything else is jsdom.npm run storybook→ http://localhost:6007/. Confirm the story actually renders and behaves (deprecated Storyshots/Karma are gone; there is no separate browser-tests server).content/visualPickerFigure, render props likerenderItem,iconprops,events), not assumptions — a common source of "component looks broken" reports has been stories authored against the wrong API. Cross-check againstcomponents/<name>/__examples__..d.ts(they're generated by the build); JS consumers rely on them via editor type-acquisition.REVIEWER checklist (do not remove)
CIworkflow: lint, typecheck, test, build). Chromatic visual review, if configured, has been checked.components/__tests__/__snapshots__/story-snapshots.test.jsx.snap).@salesforce/design-system-react/components/<name>and nested paths resolve for ESM, CJS, and types). Removing/renaming a public component or export is a breaking change →feat!:/BREAKING CHANGE:and a major version bump.