Skip to content

test(angular-query-experimental/injectQueries): switch 'isRestoring' test to '@Component' + 'render' pattern#10563

Merged
sukvvon merged 1 commit intomainfrom
test/angular-query-inject-queries-is-restoring-render-pattern
Apr 23, 2026
Merged

test(angular-query-experimental/injectQueries): switch 'isRestoring' test to '@Component' + 'render' pattern#10563
sukvvon merged 1 commit intomainfrom
test/angular-query-inject-queries-is-restoring-render-pattern

Conversation

@sukvvon
Copy link
Copy Markdown
Collaborator

@sukvvon sukvvon commented Apr 23, 2026

🎯 Changes

Align the isRestoring test in injectQueries with the rest of the suite by using a @Component + @testing-library/angular render() setup instead of TestBed.runInInjectionContext. This verifies behavior through a real component/template rather than a synthetic injection context.

✅ 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
    • Improved test coverage for query restoration state validation by refactoring how test assertions are performed.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 48e2693f-88e1-40a3-8aa0-3546d08c31d2

📥 Commits

Reviewing files that changed from the base of the PR and between e236194 and d0b5051.

📒 Files selected for processing (1)
  • packages/angular-query-experimental/src/__tests__/inject-queries.test.ts

📝 Walkthrough

Walkthrough

A test in the Angular-experimental package was refactored to replace direct injection context execution with a component-based rendering approach. The test now renders a Page component containing injectQueries and asserts status values through DOM text content instead of direct return values, while maintaining existing expectations about query function invocations.

Changes

Cohort / File(s) Summary
Angular-experimental test refactoring
packages/angular-query-experimental/src/__tests__/inject-queries.test.ts
Test pattern refactored from TestBed.runInInjectionContext to rendering a component and asserting against DOM output; preserved existing expectations for query function behavior during time advances.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

package: angular-query-experimental

Poem

🐰 From injection contexts, the test did leap,
Into rendered components, assertions run deep,
DOM text whispers what queries believe,
No more direct returns—just DOM to perceive!
A refactored dance, both elegant and neat. 🎭

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: switching the 'isRestoring' test to use '@component' + 'render' pattern instead of TestBed.runInInjectionContext.
Description check ✅ Passed The description follows the template structure, includes a clear explanation of changes, has a completed checklist, and properly indicates this is a dev-only change with no release impact.
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.

✏️ 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/angular-query-inject-queries-is-restoring-render-pattern

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

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Apr 23, 2026

View your CI Pipeline Execution ↗ for commit d0b5051

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

☁️ Nx Cloud last updated this comment at 2026-04-23 06:11:49 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

pkg-pr-new Bot commented Apr 23, 2026

More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: d0b5051

@github-actions
Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 11.99 KB (0%)
react minimal 9.02 KB (0%)

@sukvvon sukvvon merged commit 0f339c1 into main Apr 23, 2026
10 checks passed
@sukvvon sukvvon deleted the test/angular-query-inject-queries-is-restoring-render-pattern branch April 23, 2026 06:12
@sukvvon sukvvon self-assigned this Apr 23, 2026
Ephem pushed a commit to Ephem/react-query that referenced this pull request Apr 23, 2026
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