Repository navigation
Quieten the remaining frontend spec warnings - #25361
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved blocking issues were identified.
Pull request overview
Updates frontend test setup and specs to reduce expected Vitest warning noise.
Changes:
- Aligns Vitest dependencies to 4.1.11.
- Handles Lit and teardown warnings in scoped test contexts.
- Makes expected errors, prompts, and fixture behavior explicit.
File summaries
| File | Description |
|---|---|
frontend/src/test-browser-polyfills.ts |
Seeds Lit warning registry. |
frontend/src/stimulus/controllers/dynamic/work-packages/activities-tab/polling.controller.spec.ts |
Asserts expected polling errors. |
frontend/src/app/shared/directives/sortable-lists/sortable-lists.directive.behavior.spec.ts |
Prevents component ID collisions. |
frontend/src/app/shared/components/fields/edit/services/global-edit-form-changes-tracker/global-edit-form-changes-tracker.service.spec.ts |
Stubs confirmation prompts. |
frontend/src/app/shared/components/autocompleter/op-autocompleter/op-autocompleter.spec.ts |
Handles expected errors and warnings. |
frontend/package.json |
Updates Vitest dependencies. |
frontend/package-lock.json |
Updates and deduplicates Vitest packages. |
Review details
Files not reviewed (1)
- frontend/package-lock.json: Generated file
- Files reviewed: 6/7 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
946f793 to
90c2f16
Compare
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |
90c2f16 to
1a88932
Compare
|
Warning This pull request does not link an OpenProject work package. Please add a link to the work package in the description, or reference it in the |
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |
`vitest` resolved to 4.1.11 while `@vitest/browser` stayed at 4.1.10, so every run opened with a "Running mixed versions is not supported" warning.
Lit prints the notice once per test realm, so it repeated across the run without telling anyone anything new.
ng-select's panel measurement emits after the panel is destroyed, which flooded the run with two dozen warnings from a single spec.
The logged errors were part of the behavior under test, so they printed as noise instead of being checked.
The specs relied on Vitest answering an unmocked `confirm()` with false, which it announces on every call.
Two host components share a template and have no selector, so Angular generated the same component ID for both and warned about the collision.
1a88932 to
4e13c3e
Compare
Ticket
No work package. Frontend test-output hygiene, following up on #24622.
What are you trying to accomplish?
Removes most of the remaining non-failure noise from
npm run testso real warnings stand out:vitest4.1.11 vs@vitest/browser4.1.10)NG0953: Unexpected emit for destroyed OutputRefwarnings from the autocompleter debounce specconfirm()in the global edit-form changes tracker specconsole.erroroutput from two error-path specs (autocompleter lookup failure, activities polling)NG0912component ID collision in the sortable-lists directive specTogether with #24622, the only warnings left are the
useDispatch()deprecation and FullCalendar's unknowndayGridClassNamesoption, which get their own PRs.What approach did you choose and why?
Each warning is handled where it comes from. There is no global console filter.
@vitest/browser-playwrightand@vitest/coverage-v8to^4.1.11. The lockfile change only dedupes nested@vitest/*copies.globalThis.litIssuedWarningsintest-browser-polyfills.ts, which runs before any module imports Lit. Lit checks this set itself before warning. Both keys are needed because lit-html dedupes by code and@lit/reactive-elementby the full message._measureDimensionsretries through a Promise +requestAnimationFramechain with no destroyed guard. Closing the select or flushing a frame before teardown did not stop it, so the spec reuses the file's existing scopedsilenceDestroyedOutputWarning()stopgap. The helper's comment now names the actual cause and links the upstream report, NgDropdownPanelComponent emits update/scroll after destruction (NG0953) ng-select/ng-select#2869, which is still unfixed in 24.1.2.console.errorand assert it was called with the error.confirm(): the specs relied on Vitest answeringfalse. They now stub the declined prompt explicitly.AI involvement
Directed – I specified the requirements and AI implemented most of it; I validated via testing rather than a full line-by-line review.
Merge checklist