Skip to content

test(query-devtools/Devtools): add test for restoring previous query options after 'Trigger Loading' is clicked#10701

Merged
sukvvon merged 2 commits into
mainfrom
test/query-devtools-devtools-restore-loading-action
May 13, 2026
Merged

test(query-devtools/Devtools): add test for restoring previous query options after 'Trigger Loading' is clicked#10701
sukvvon merged 2 commits into
mainfrom
test/query-devtools-devtools-restore-loading-action

Conversation

@sukvvon
Copy link
Copy Markdown
Collaborator

@sukvvon sukvvon commented May 13, 2026

🎯 Changes

Adds a test for Devtools.tsx covering the restoreQueryAfterLoadingOrError flow that runs when the user clicks Restore Loading after Trigger Loading:

  • should restore the previous query options when "Restore Loading" is clicked after "Trigger Loading"

The first click on Trigger Loading switches the query into a pending state with data: undefined and stashes the original options in fetchMeta.__previousQueryOptions. The second click cancels the never-resolving fetch and refetches with those stashed options, restoring the original data. Neither the restoreQueryAfterLoadingOrError function nor the Trigger Loading else-branch was covered before.

Coverage delta on Devtools.tsx: Stmts 93.56 → 95.30, Branch 76.79 → 78.19, Funcs 94.90 → 95.78, Lines 93.93 → 96.07.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented May 13, 2026

View your CI Pipeline Execution ↗ for commit 880d672

Command Status Duration Result
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 27s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-13 16:33:59 UTC

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 13, 2026

🚀 Changeset Version Preview

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

@sukvvon sukvvon self-assigned this May 13, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 13, 2026

More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 683ad58

@github-actions
Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 12.1 KB (0%)
react minimal 9.07 KB (0%)

@sukvvon sukvvon merged commit 28177f5 into main May 13, 2026
11 of 12 checks passed
@sukvvon sukvvon deleted the test/query-devtools-devtools-restore-loading-action branch May 13, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant