Skip to content

test(query-devtools/utils): add tests for 'array nested path' and 'primitive' cases of 'deleteNestedDataByPath'#10673

Merged
sukvvon merged 1 commit intomainfrom
test/query-devtools-delete-nested-data-by-path-coverage
May 9, 2026
Merged

test(query-devtools/utils): add tests for 'array nested path' and 'primitive' cases of 'deleteNestedDataByPath'#10673
sukvvon merged 1 commit intomainfrom
test/query-devtools-delete-nested-data-by-path-coverage

Conversation

@sukvvon
Copy link
Copy Markdown
Collaborator

@sukvvon sukvvon commented May 9, 2026

🎯 Changes

Add tests covering the two remaining branches of the deleteNestedDataByPath helper in query-devtools/utils.tsx. The existing suite already exercises the single-step array, object, set, map, and deeply-nested cases; this PR fills in the branches that weren't hit yet.

Cases:

  • array nested path — recurses into an element of an array when deletePath.length > 1
  • primitive — returns primitive data unchanged when it is not an Object / Array / Map / Set

✅ 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
    • Expanded test coverage for nested data operations and primitive value handling.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 9, 2026

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: adea8406-d636-4210-9e4c-8c589219a4d4

📥 Commits

Reviewing files that changed from the base of the PR and between 8dd9724 and b4d568f.

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

📝 Walkthrough

Walkthrough

This PR adds test coverage to the deleteNestedDataByPath utility function in the query-devtools package. Two new test cases verify that the function correctly deletes nested properties within array elements and returns primitive inputs unchanged.

Changes

deleteNestedDataByPath Test Coverage

Layer / File(s) Summary
Test Cases
packages/query-devtools/src/__tests__/utils.test.ts
Adds test coverage for nested property deletion within array objects and validates that primitive inputs are returned unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Suggested labels

package: query-devtools

Poem

🐰 A fuzzy test hops in with care,
Nested paths deleted with flair,
Arrays and primitives all pass the test,
This delete function is truly blessed!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding test cases for two specific branches ('array nested path' and 'primitive') of the deleteNestedDataByPath function.
Description check ✅ Passed The description follows the template structure with complete 'Changes' and 'Checklist' sections, includes specific case descriptions, and properly identifies the change as dev-only 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/query-devtools-delete-nested-data-by-path-coverage

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

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented May 9, 2026

View your CI Pipeline Execution ↗ for commit b4d568f

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

☁️ Nx Cloud last updated this comment at 2026-05-09 05:23:12 UTC

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 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 9, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 9, 2026

More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: b4d568f

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

size-limit report 📦

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

@sukvvon sukvvon merged commit a709b04 into main May 9, 2026
10 checks passed
@sukvvon sukvvon deleted the test/query-devtools-delete-nested-data-by-path-coverage branch May 9, 2026 05:26
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