Skip to content

test(angular-query-experimental/injectQueries): remove duplicate 'render' providers already configured in 'beforeEach'#10541

Merged
sukvvon merged 1 commit intomainfrom
test/angular-query-inject-queries-remove-duplicate-render-providers
Apr 21, 2026
Merged

test(angular-query-experimental/injectQueries): remove duplicate 'render' providers already configured in 'beforeEach'#10541
sukvvon merged 1 commit intomainfrom
test/angular-query-inject-queries-remove-duplicate-render-providers

Conversation

@sukvvon
Copy link
Copy Markdown
Collaborator

@sukvvon sukvvon commented Apr 21, 2026

🎯 Changes

Removes the duplicate providers argument from render(Page, { providers: [...] }) in inject-queries.test.ts. The beforeEach hook already configures the same providers via TestBed.configureTestingModule, so @testing-library/angular's render() inherits them and the explicit second registration is redundant.

Before

beforeEach(() => {
  vi.useFakeTimers()
  queryClient = new QueryClient()
  TestBed.configureTestingModule({
    providers: [
      provideZonelessChangeDetection(),
      provideTanStackQuery(queryClient),
    ],
  })
})

// ...

const rendered = await render(Page, {
  providers: [
    provideZonelessChangeDetection(),
    provideTanStackQuery(queryClient),
  ],
})

After

const rendered = await render(Page)

Scope

Only the two call sites in injectQueries's top-level tests — the isRestoring block still calls TestBed.resetTestingModule() and must re-register providers (including provideIsRestoring), so it's intentionally left untouched.

Verification

  • @tanstack/angular-query-experimental — 208 tests passed, 0 type errors
  • src/inject-queries.ts coverage unchanged (100% across Stmts/Branch/Funcs/Lines)

✅ 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
    • Simplified test setup by consolidating Angular provider configuration, reducing redundancy in individual test cases while maintaining existing test coverage and assertions.

…der' providers already configured in 'beforeEach'
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 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: 0419a2ad-a179-4a1c-aa2a-98a003c187f3

📥 Commits

Reviewing files that changed from the base of the PR and between 646f04e and 63872ff.

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

📝 Walkthrough

Walkthrough

Simplified test provider configuration in inject-queries.test.ts by removing explicit provider arguments from render() calls and relying on centralized TestBed.configureTestingModule() setup instead.

Changes

Cohort / File(s) Summary
Test Provider Cleanup
packages/angular-query-experimental/src/__tests__/inject-queries.test.ts
Removed explicit provideZonelessChangeDetection() and provideTanStackQuery(queryClient) arguments from two test case render() calls, consolidating provider configuration to TestBed setup.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 Hop hop, the providers take the stage,
No longer scattered, page by page,
TestBed gathers all in place,
Tests run cleaner at a rapid pace!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: removing duplicate provider configuration from render() calls that were already configured in beforeEach.
Description check ✅ Passed The description comprehensively covers all required sections with before/after code, detailed scope explanation, and verification results, matching the template requirements.
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-remove-duplicate-render-providers

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

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Apr 21, 2026

View your CI Pipeline Execution ↗ for commit 63872ff

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

☁️ Nx Cloud last updated this comment at 2026-04-21 02:41:04 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 21, 2026

More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 63872ff

@sukvvon sukvvon self-assigned this Apr 21, 2026
@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 50d08de into main Apr 21, 2026
10 checks passed
@sukvvon sukvvon deleted the test/angular-query-inject-queries-remove-duplicate-render-providers branch April 21, 2026 02:48
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