chore(test): silence Vue warnings in the unit test suite - #7110
Merged
Conversation
Cuts [Vue warn] output in `npm run unit` from 75 to 5 with no change to
test counts (299 files / 4412 tests still pass).
- setup.js: register the kvTrackEvent directive and an apollo provide as
VTU config.global defaults, so specs get the basics without opting in.
- specUtils.js: add routerLinkStub and mockRouterObject as opt-in helpers.
These can't be global: registering RouterLink or providing routerKey
suite-wide collides with the specs that build a real router, where
<router-link> is expected to render an anchor with role="link".
- routerLinkStub renders a literal <router-link to="..."> element, matching
the DOM Vue emitted while the component was unresolved, so specs that
query `router-link[to="..."]` or getAttribute('to') keep working. The goal
is to silence the resolve warning, not to change rendered output.
- BadgeMilestone.spec.js spread globalOptions at the top level of its render
options, where VTU ignores directives/provide/mocks; its mocks were inert.
Two import-order constraints are documented in the files: setup.js must not
import from #src (importing KvAuth0 pulled in syncDate and broke
syncDate.spec.js, which mocks timesync), and specUtils.js must not import
routerKey from vue-router (it breaks collection of specs that mock
vue-router without re-exporting it).
Two of the eleven tests called useMyKivaHome() bare, outside any component, so the composable's onMounted hook had no instance to attach to and Vue warned. Wrap both in a TestComponent, matching the other nine tests. The 'reactive computed properties' test asserts pre-fetch defaults, which depends on the mount hook not having completed. Its assertions stay synchronous after render(): onMounted now fires, but its apollo query resolves on a later microtask, so the values are still the defaults. The flip to /mykiva after resolution is covered separately. Vue warnings in `npm run unit` drop from 5 to 3.
dyersituations
approved these changes
Jul 28, 2026
kiva-robot
added a commit
that referenced
this pull request
Jul 29, 2026
## [3.81.0-rc.1](v3.80.0...v3.81.0-rc.1) (2026-07-29) ### 🎉 New Features * [MP-3057] - goal in review slide 4 ([#7089](#7089)) ([4db4ab2](4db4ab2)) * create slides 5 to 7 to goal in review modal ([636bf35](636bf35)) * meta event cleanup ([#7108](#7108)) ([8bf4c15](8bf4c15)) * **sitemap:** resolve and link redirect targets in the route listing ([#7111](#7111)) ([d28b2e6](d28b2e6)) ### 🐛 Bugfixes * align comment section visibility with legacy showSocialInfo rules ([83d7da3](83d7da3)) * beta page minor tweaks ([#7117](#7117)) ([cc7bf6a](cc7bf6a)) * **borrower-profile:** show comments only to privileged users ([94d21c0](94d21c0)) * conflicts ([8d5ef8a](8d5ef8a)) * **esiHead:** read the basket cookie instead of creating a basket ([2442ed2](2442ed2)) * font size in collective impact section ([939f93c](939f93c)) * hide borrower profile comments on anonymized loans for all users ([ad908b7](ad908b7)) * in-progress goal copy in form slide ([672ad7d](672ad7d)) * lint issue ([0478e38](0478e38)) * require lending to the loan for fundraising comment eligibility ([9ed01b2](9ed01b2)) * resolve issues with date picker on transaction beta ([#7112](#7112)) ([1effc61](1effc61)) * solve design comments ([1585b60](1585b60)) * unrelevant comment ([39595d1](39595d1)) ### 🪚 Refactors * **borrower-profile:** drop canAddComment gating from LoanComments ([d4efb82](d4efb82)) ### 🔍 Tests * **esiHead:** cover the basket-gated shop query ([114bcc1](114bcc1)) ### 🧹 Chores * **deps-dev:** bump @babel/core from 7.24.5 to 7.29.7 ([#7094](#7094)) ([ab4e380](ab4e380)) * **deps-dev:** bump postcss from 8.5.10 to 8.5.12 ([#7091](#7091)) ([476cde0](476cde0)) * **deps-dev:** bump postcss from 8.5.12 to 8.5.18 ([#7101](#7101)) ([0375b47](0375b47)) * **deps:** bump @grpc/grpc-js from 1.9.13 to 1.14.4 ([#6979](#6979)) ([c18472a](c18472a)) * **deps:** bump auth0-js from 9.19.2 to 10.0.0 ([#6886](#6886)) ([20fc0d0](20fc0d0)) * **deps:** bump axios from 1.13.5 to 1.18.1 ([#7073](#7073)) ([e2cc6d1](e2cc6d1)) * **deps:** bump body-parser from 1.20.4 to 1.20.6 ([#7077](#7077)) ([5b1e248](5b1e248)) * **deps:** bump immutable from 5.1.5 to 5.1.9 ([#7083](#7083)) ([9b9fab6](9b9fab6)) * **deps:** bump json-schema and jsprim ([#7099](#7099)) ([8e77dd8](8e77dd8)) * **deps:** bump piscina from 4.7.0 to 4.9.3 ([#7009](#7009)) ([875d847](875d847)) * **deps:** bump serialize-javascript from 7.0.4 to 7.0.7 ([#7096](#7096)) ([7004bf6](7004bf6)) * **deps:** bump svgo from 3.3.3 to 3.3.4 ([#7084](#7084)) ([05f7bd9](05f7bd9)) * **deps:** bump the minor-patch-other group across 1 directory with 30 updates ([#7100](#7100)) ([a348e75](a348e75)) * **deps:** bump uuid from 8.3.2 to 14.0.0 ([#6861](#6861)) ([e8b3ea1](e8b3ea1)) * **deps:** bump vue3-touch-events from 4.1.8 to 5.0.15 ([#6740](#6740)) ([63a35b9](63a35b9)) * **deps:** bump web-vitals from 3.5.2 to 6.0.0 ([#6941](#6941)) ([31f3af6](31f3af6)) * review and approve deps with install scripts in ui repo ([84fb538](84fb538)) * **test:** silence Vue warnings in the unit test suite ([#7110](#7110)) ([aab489a](aab489a)) * upgrade Node from 20 to 24 ([#7107](#7107)) ([5a26c89](5a26c89))
Collaborator
|
🎉 This PR is included in version 3.81.0-rc.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
kiva-robot
added a commit
that referenced
this pull request
Jul 30, 2026
## [3.81.0](v3.80.0...v3.81.0) (2026-07-30) ### 🎉 New Features * [MP-3057] - goal in review slide 4 ([#7089](#7089)) ([4db4ab2](4db4ab2)) * create slides 5 to 7 to goal in review modal ([636bf35](636bf35)) * meta event cleanup ([#7108](#7108)) ([8bf4c15](8bf4c15)) * **sitemap:** resolve and link redirect targets in the route listing ([#7111](#7111)) ([d28b2e6](d28b2e6)) ### 🐛 Bugfixes * align comment section visibility with legacy showSocialInfo rules ([83d7da3](83d7da3)) * beta page minor tweaks ([#7117](#7117)) ([cc7bf6a](cc7bf6a)) * **borrower-profile:** show comments only to privileged users ([94d21c0](94d21c0)) * conflicts ([8d5ef8a](8d5ef8a)) * **esiHead:** read the basket cookie instead of creating a basket ([2442ed2](2442ed2)) * font size in collective impact section ([939f93c](939f93c)) * hide borrower profile comments on anonymized loans for all users ([ad908b7](ad908b7)) * in-progress goal copy in form slide ([672ad7d](672ad7d)) * lint issue ([0478e38](0478e38)) * require lending to the loan for fundraising comment eligibility ([9ed01b2](9ed01b2)) * resolve issues with date picker on transaction beta ([#7112](#7112)) ([1effc61](1effc61)) * solve design comments ([1585b60](1585b60)) * unrelevant comment ([39595d1](39595d1)) * update kv-components and kv-shop with latest versions to support header experiment ([d7e631a](d7e631a)) ### 🪚 Refactors * **borrower-profile:** drop canAddComment gating from LoanComments ([d4efb82](d4efb82)) ### 🔍 Tests * **esiHead:** cover the basket-gated shop query ([114bcc1](114bcc1)) ### 🧹 Chores * **deps-dev:** bump @babel/core from 7.24.5 to 7.29.7 ([#7094](#7094)) ([ab4e380](ab4e380)) * **deps-dev:** bump postcss from 8.5.10 to 8.5.12 ([#7091](#7091)) ([476cde0](476cde0)) * **deps-dev:** bump postcss from 8.5.12 to 8.5.18 ([#7101](#7101)) ([0375b47](0375b47)) * **deps:** bump @grpc/grpc-js from 1.9.13 to 1.14.4 ([#6979](#6979)) ([c18472a](c18472a)) * **deps:** bump auth0-js from 9.19.2 to 10.0.0 ([#6886](#6886)) ([20fc0d0](20fc0d0)) * **deps:** bump axios from 1.13.5 to 1.18.1 ([#7073](#7073)) ([e2cc6d1](e2cc6d1)) * **deps:** bump body-parser from 1.20.4 to 1.20.6 ([#7077](#7077)) ([5b1e248](5b1e248)) * **deps:** bump immutable from 5.1.5 to 5.1.9 ([#7083](#7083)) ([9b9fab6](9b9fab6)) * **deps:** bump json-schema and jsprim ([#7099](#7099)) ([8e77dd8](8e77dd8)) * **deps:** bump piscina from 4.7.0 to 4.9.3 ([#7009](#7009)) ([875d847](875d847)) * **deps:** bump serialize-javascript from 7.0.4 to 7.0.7 ([#7096](#7096)) ([7004bf6](7004bf6)) * **deps:** bump svgo from 3.3.3 to 3.3.4 ([#7084](#7084)) ([05f7bd9](05f7bd9)) * **deps:** bump the minor-patch-other group across 1 directory with 30 updates ([#7100](#7100)) ([a348e75](a348e75)) * **deps:** bump uuid from 8.3.2 to 14.0.0 ([#6861](#6861)) ([e8b3ea1](e8b3ea1)) * **deps:** bump vue3-touch-events from 4.1.8 to 5.0.15 ([#6740](#6740)) ([63a35b9](63a35b9)) * **deps:** bump web-vitals from 3.5.2 to 6.0.0 ([#6941](#6941)) ([31f3af6](31f3af6)) * **release:** 3.81.0-rc.1 [skip ci] ([0163e6b](0163e6b)), closes [#7089](#7089) [#7108](#7108) [#7111](#7111) [#7117](#7117) [#7112](#7112) [#7094](#7094) [#7091](#7091) [#7101](#7101) [#6979](#6979) [#6886](#6886) [#7073](#7073) [#7077](#7077) [#7083](#7083) [#7099](#7099) [#7009](#7009) [#7096](#7096) [#7084](#7084) [#7100](#7100) [#6861](#6861) [#6740](#6740) [#6941](#6941) [#7110](#7110) [#7107](#7107) * **release:** 3.81.0-rc.2 [skip ci] ([be0c580](be0c580)) * review and approve deps with install scripts in ui repo ([84fb538](84fb538)) * **test:** silence Vue warnings in the unit test suite ([#7110](#7110)) ([aab489a](aab489a)) * upgrade Node from 20 to 24 ([#7107](#7107)) ([5a26c89](5a26c89))
Collaborator
|
🎉 This PR is included in version 3.81.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
What
Cuts
[Vue warn]output fromnpm run unitfrom 75 to 3, with no changeto what the suite covers: 299 files / 4412 tests pass before and after, none
added, skipped, or removed.
The noise made it hard to spot a real failure in CI output, and two of the
warnings turned out to be masking actual spec bugs (see below).
Why the shared config is split two ways
test/unit/setup.jsgets the defaults that can't collide — thekvTrackEventdirective and an
apolloprovide, via VTUconfig.global. Specs' ownglobalblocks merge on top and still win.
test/unit/specUtils.jsgetsrouterLinkStubandmockRouterObjectasopt-in helpers. These deliberately are not global: registering
RouterLinkor providing vue-router's
routerKeysuite-wide collides with the three specsthat build a real router (
BasketItem,ThanksPageSingleVersion,RouteListing), where<router-link>is expected to render an anchor withrole="link". My first attempt did make them global and brokeBasketItem'sgetByRole('link').routerLinkStubrenders a literal<router-link to="...">element, matchingthe DOM Vue emitted while the component was unresolved. That's intentional:
specs query
router-link[to="..."](TeamMessageCard) andgetAttribute('to')(
TeamCard). The goal is to silence the resolve warning, not to change renderedoutput — so this PR changes no assertions.
Two spec bugs the warnings were hiding
BadgeMilestone.spec.jsspreadglobalOptionsat the top level of itsrender options, where VTU ignores
directives/provide/mocksentirely.Its mocks were inert across all 8 tests. Now
global: globalOptions.useMyKivaHome.spec.jscalled the composable bare in 2 of 11 tests, soits
onMountedhad no instance to attach to. Both now wrap it in aTestComponentlike the other nine.The
reactive computed propertiestest asserts pre-fetch defaults, whichdepends on the mount hook not having completed. Its assertions stay
synchronous after
render():onMountedfires, but its apollo queryresolves on a later microtask, so the values are still the defaults. The flip
to
/mykivaafter resolution is covered by two sibling tests, which confirmsthat assertion isn't trivially true.
Two import-order constraints, documented in the files
Both cost a debugging cycle, so they're comments where the next person will hit
them:
setup.jsmust not import from#src. ImportingKvAuth0pulled insyncDatebeforesyncDate.spec.jscouldvi.mock('timesync'), breaking all10 of its tests.
specUtils.jsmust not importrouterKeyfromvue-router. Several specsvi.mock('vue-router')without re-exporting it, and the import broke theircollection. The one spec that needs the key imports it directly.
The 3 remaining warnings
All intentional or out of scope:
injection "apollo" not foundcreateApp, soconfig.globalnever appliesInvalid prop: custom validator "state"FeaturedGoalCarddeliberately passesstate="something-unsupported"Invalid prop: type check "to"RouteListing.vue:56, tackled separatelyTesting
npm run unit— 299 files / 4412 tests pass, exit 0npm run lint— exit 0 (the 7 remaining warnings are pre-existing GraphQLschema warnings in untouched files)
test/only