Skip to content

test(solid-query-persist-client/PersistQueryClientProvider): use 'toStrictEqual' to assert the exact state shape#11047

Merged
sukvvon merged 1 commit into
mainfrom
test/solid-persist-strictequal
Jul 11, 2026
Merged

test(solid-query-persist-client/PersistQueryClientProvider): use 'toStrictEqual' to assert the exact state shape#11047
sukvvon merged 1 commit into
mainfrom
test/solid-persist-strictequal

Conversation

@sukvvon

@sukvvon sukvvon commented Jul 11, 2026

Copy link
Copy Markdown
Member

🎯 Changes

Follow-up to #11044. The states assertions check the pending state as { status: 'pending', fetchStatus: 'idle', data: undefined }. With toEqual, a missing data key is treated the same as data: undefined, so a regression where the pending state stops including the data property would go unnoticed. toStrictEqual requires the data key to be explicitly present, which is the actual intent here.

All states assertions in the file are switched together to keep the matcher consistent within the same state-transition sequence.

✅ Checklist

🚀 Release Impact

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

Summary by CodeRabbit

  • Tests
    • Strengthened test assertions for query state transitions during cache restoration, fetching, and persistence flows.
    • Improved validation of status, fetch status, and returned data across multiple client scenarios.

@nx-cloud

nx-cloud Bot commented Jul 11, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 27a56e6

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

☁️ Nx Cloud last updated this comment at 2026-07-11 04:51:08 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: 344df0ee-bf16-4909-aed4-50d157b6f46d

📥 Commits

Reviewing files that changed from the base of the PR and between f79938e and 27a56e6.

📒 Files selected for processing (1)
  • packages/solid-query-persist-client/src/__tests__/PersistQueryClientProvider.test.tsx

📝 Walkthrough

Walkthrough

Changes

Persistence provider test assertions

Layer / File(s) Summary
Tighten captured state assertions
packages/solid-query-persist-client/src/__tests__/PersistQueryClientProvider.test.tsx
Five restoration and persistence scenarios now use toStrictEqual for captured status, fetchStatus, and data state transitions.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is specific and accurately summarizes the test-only switch to toStrictEqual in PersistQueryClientProvider tests.
Description check ✅ Passed The description matches the required template and includes the changes, checklist, and release impact sections.
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/solid-persist-strictequal

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@11047

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 27a56e6

@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 7bc3415 into main Jul 11, 2026
9 checks passed
@sukvvon sukvvon deleted the test/solid-persist-strictequal branch July 11, 2026 04:51
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