Skip to content

test(query-devtools/utils): add tests for 'getSidedProp'#10647

Merged
sukvvon merged 1 commit into
mainfrom
test/query-devtools-get-sided-prop
May 5, 2026
Merged

test(query-devtools/utils): add tests for 'getSidedProp'#10647
sukvvon merged 1 commit into
mainfrom
test/query-devtools-get-sided-prop

Conversation

@sukvvon
Copy link
Copy Markdown
Collaborator

@sukvvon sukvvon commented May 5, 2026

🎯 Changes

Add unit tests for the getSidedProp helper in query-devtools/utils.tsx.

The helper builds a sided property name by appending the capitalized side to a base prop (e.g. getSidedProp('margin', 'top') === 'marginTop').

Cases cover all four DevtoolsPosition values: top, bottom, left, right.

The Capitalize<DevtoolsPosition> template literal type only enforces the return type shape, not the runtime capitalization logic — so dropping toUpperCase() would still type-check but break at runtime. These tests guard that behavior.

✅ 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 with additional test cases for property name utility functions, ensuring correct camel-case conversion for spacing-related properties.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 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: 699aff9f-7f10-467e-b2d2-28af1c0e8038

📥 Commits

Reviewing files that changed from the base of the PR and between 3c24bc8 and c883bd6.

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

📝 Walkthrough

Walkthrough

Test coverage is added for the getSidedProp utility function, verifying it correctly generates camel-cased CSS property names when combining base properties ('margin', 'padding') with directional qualifiers ('top', 'bottom', 'left', 'right').

Changes

Test Suite for getSidedProp

Layer / File(s) Summary
Import & Test Suite
packages/query-devtools/src/__tests__/utils.test.ts
getSidedProp added to imports. New test suite verifies the function returns correct camel-cased prop names (marginTop, marginBottom, paddingLeft, paddingRight) for each side input.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 From sides we craft the perfect name,
Margin-top and padding's game,
CamelCase flows smooth and bright,
Tests ensure each side's just right! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding tests for the 'getSidedProp' utility function in query-devtools.
Description check ✅ Passed The description follows the template structure with all required sections completed: detailed 'Changes' section explaining the helper function and test coverage rationale, all checklist items checked appropriately, and correct release impact marking.
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-get-sided-prop

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 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 5, 2026
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented May 5, 2026

View your CI Pipeline Execution ↗ for commit c883bd6

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

☁️ Nx Cloud last updated this comment at 2026-05-05 18:28:52 UTC

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 5, 2026

More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: c883bd6

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

size-limit report 📦

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

@sukvvon sukvvon merged commit 8a5d189 into main May 5, 2026
10 checks passed
@sukvvon sukvvon deleted the test/query-devtools-get-sided-prop branch May 5, 2026 18:35
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