Skip to content

test(vue-query/vueQueryPlugin): assert exact booleans with 'toBe' instead of 'toBeTruthy'/'toBeFalsy'#11049

Merged
sukvvon merged 1 commit into
mainfrom
test/vue-plugin-boolean-assertions
Jul 11, 2026
Merged

test(vue-query/vueQueryPlugin): assert exact booleans with 'toBe' instead of 'toBeTruthy'/'toBeFalsy'#11049
sukvvon merged 1 commit into
mainfrom
test/vue-plugin-boolean-assertions

Conversation

@sukvvon

@sukvvon sukvvon commented Jul 11, 2026

Copy link
Copy Markdown
Member

🎯 Changes

Follow-up to #11043 (same change, for the vue-query package). Several assertions on strictly-typed boolean values used the loose toBeTruthy()/toBeFalsy() matchers. Since these values are guaranteed boolean by their types, this tightens them to toBe(true)/toBe(false), which additionally catches a value being a truthy/falsy non-boolean instead of a real boolean.

Affected values (all boolean):

  • client.isRestoring.valueisRestoring: Ref<boolean>
  • query.isFetching.value / queries.value[0].isFetchingisFetching: boolean

✅ Checklist

🚀 Release Impact

  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Tests
    • Strengthened coverage for persisted query restoration.
    • Added explicit checks confirming queries remain idle and without data while restoration is in progress.
    • Verified fetchers are not called prematurely and restoration completes as expected.

@nx-cloud

nx-cloud Bot commented Jul 11, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit def1fa4

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 3m 45s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 19s View ↗

☁️ Nx Cloud last updated this comment at 2026-07-11 06:02:04 UTC

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 48fd262b-32a2-431b-b8dc-2d1ed5d7652e

📥 Commits

Reviewing files that changed from the base of the PR and between 0cdfdea and def1fa4.

📒 Files selected for processing (1)
  • packages/vue-query/src/__tests__/vueQueryPlugin.test.ts

📝 Walkthrough

Walkthrough

The Vue Query persister tests now explicitly verify restoring state, inactive queries, undefined data, and deferred fetcher execution for useQuery and useQueries flows.

Changes

Vue Query persister test coverage

Layer / File(s) Summary
Strengthen persister restore assertions
packages/vue-query/src/__tests__/vueQueryPlugin.test.ts
Persister tests explicitly assert isRestoring, inactive fetching state, undefined data, and unchanged fetcher calls before and after timers advance.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the test update from loose truthy checks to exact boolean assertions.
Description check ✅ Passed The description matches the template and includes changes, checklist, and release impact details.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/vue-plugin-boolean-assertions

Comment @coderabbitai help to get the list of available commands.

@sukvvon sukvvon self-assigned this Jul 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

No changeset entries found. Merging this PR will not cause a version bump for any packages.

@pkg-pr-new

pkg-pr-new Bot commented Jul 11, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@11049

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@11049

@tanstack/lit-query

npm i https://pkg.pr.new/@tanstack/lit-query@11049

@tanstack/preact-query

npm i https://pkg.pr.new/@tanstack/preact-query@11049

@tanstack/preact-query-devtools

npm i https://pkg.pr.new/@tanstack/preact-query-devtools@11049

@tanstack/preact-query-persist-client

npm i https://pkg.pr.new/@tanstack/preact-query-persist-client@11049

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@11049

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@11049

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@11049

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@11049

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@11049

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@11049

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@11049

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@11049

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@11049

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@11049

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@11049

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@11049

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@11049

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@11049

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@11049

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@11049

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@11049

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@11049

commit: def1fa4

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 12.13 KB (0%)
react minimal 9.08 KB (0%)

@sukvvon sukvvon merged commit 72e90c8 into main Jul 11, 2026
9 checks passed
@sukvvon sukvvon deleted the test/vue-plugin-boolean-assertions branch July 11, 2026 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant