Skip to content

test(query-devtools/Devtools): add test for 'static' indicator on a query with 'staleTime: static' - #10748

Merged
sukvvon merged 1 commit into
mainfrom
test/query-devtools-devtools-static-indicator
May 21, 2026
Merged

test(query-devtools/Devtools): add test for 'static' indicator on a query with 'staleTime: static'#10748
sukvvon merged 1 commit into
mainfrom
test/query-devtools-devtools-static-indicator

Conversation

@sukvvon

@sukvvonsukvvon commented May 21, 2026

Copy link
Copy Markdown
Member

🎯 Changes

Extend Devtools.test.tsx with a test that locks the static indicator rendered next to a query whose observer is configured with staleTime: 'static' — both the visible label and the accessible name on the row are asserted.

Added cases (disabled and static queries, 1):

  • should render a "static" indicator for a query with "staleTime: 'static'" — builds a query in the cache, attaches a QueryObserver with staleTime: 'static', seeds data on the query, and asserts both the static text node and the , static segment in the row's aria-label are present.

✅ 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).

Summary by CodeRabbit

  • Tests
    • Enhanced test coverage for the Query Devtools to verify static query indicators render correctly.

Review Change Stack

@coderabbitai

coderabbitaiBot commented May 21, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5b99dd04-84b0-4f36-b582-debf95bf5e23

📥 Commits

Reviewing files that changed from the base of the PR and between 3a5753f and 4bf05fd.

📒 Files selected for processing (1)
  • packages/query-devtools/src/__tests__/Devtools.test.tsx

📝 Walkthrough

Walkthrough

This PR adds a single test case to the Devtools test suite that verifies queries configured with staleTime: 'static' render a "static" indicator. The test creates a QueryObserver, renders the Devtools panel, and asserts the indicator appears in both visible text and accessibility labels.

Changes

Devtools Static Query Indicator Test

Layer / File(s)Summary
Static query indicator test case
packages/query-devtools/src/__tests__/Devtools.test.tsx
New test verifies that a query with staleTime: 'static' renders a "static" indicator in both visible text and aria label within the Devtools panel.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Suggested labels

package: query-devtools

Poem

🐰 A static query holds its ground,
Through Devtools tests, the proof is found,
No staleness here, forever true,
The indicator shines for me and you! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Title check✅ PassedThe title clearly and specifically describes the main change: adding a test for a 'static' indicator on a query with 'staleTime: static' in the Devtools test file.
Description check✅ PassedThe description comprehensively covers all required template sections: changes are detailed, checklist items are properly addressed, and release impact is clearly specified as dev-only.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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/query-devtools-devtools-static-indicator

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

@nx-cloud

nx-cloudBot commented May 21, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 4bf05fd

CommandStatusDurationResult
nx affected --targets=test:sherif,test:knip,tes...✅ Succeeded3m 11sView ↗

☁️ Nx Cloud last updated this comment at 2026-05-21 10:43:17 UTC

@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

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 4bf05fd

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
react full12.1 KB (0%)
react minimal9.07 KB (0%)

@sukvvonsukvvon self-assigned this May 21, 2026
@sukvvon
sukvvon merged commit fe54a9c into mainMay 21, 2026
15 of 17 checks passed
@sukvvon
sukvvon deleted the test/query-devtools-devtools-static-indicator branch May 21, 2026 11:28
Sign up for freeto 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

@sukvvon