fix: wait for the admin record heading in command palette tests

Merged
CU
3d ago
+261-74

Summary

  • The admin command palette tests wait for the record heading instead of findByText on the organization name.
  • A disabled organization is matched by the option's accessible name, which includes "Disabled".
  • The palette test no longer asserts the custom-domain page's own organizationId query. CustomDomain.test.tsx already covers that.
  • This branch also carries the TanStack group bump (React Query 5.105.3, charts, react-hotkeys, react-virtual), the same updates as #8919.

Motivation

findByText only passes while exactly one element has that text. The organization page renders the name in the sidebar, the breadcrumb, the record heading, and the details row. React Query 5.105 paints all four in one commit, so the three record-page tests timed out. The heading is the one unique copy, and it appears once the organization query the palette shares with the record layout has resolved.

The other assertions in this file stay. The handoff form, the debounce, and the result counts are the behavior those tests exist to pin down.

Gutternote review steps

No visible change from the test edit.

The dependency bump matches #8919. Spot-check that surface:

  1. Open an organization (/organizations/<slug>).
  2. Press Cmd+K or Ctrl+K. Search for that organization, and while you are on its record confirm Billing is offered.
  3. Open that organization's spend or usage chart and confirm it still draws.

Also check: a search for a disabled organization shows Disabled and does not offer Open in Dashboard.

Open in Web View Automation 

Summary by cubic

Fixes the admin command palette tests so they wait for the record heading instead of the organization name, which renders in four places and caused timeouts after React Query 5.105 painted them in one commit. Also bumps the TanStack group dependencies and moves spend breakdown validation into the query function.

  • The spend breakdown sections now validate responses in queryFn instead of select, so invalid responses are rejected before caching and refresh alerts show the last successful estimates.
  • Automatic query retries are preserved for ordinary failures; invalid spend responses still skip retrying.
  • Match disabled organization options by their accessible name, including "Disabled", instead of reading textContent.
  • Drop the custom-domain test's assertion on the organizationId query, already covered by CustomDomain.test.tsx.

Dependencies

  • Bump @tanstack/react-query to 5.105.3, plus @tanstack/charts, @tanstack/react-hotkeys, @tanstack/react-virtual, and the TanStack lockfile.

🚀 Preview Environment (PR #9089)

Preview URL: https://pr-9089.dev.getgram.ai

ComponentStatusDetailsUpdated (UTC)
✅ DatabaseReadyExisting database reused2026-11-16 22:13:44.
✅ ImagesAvailableContainer images ready2026-11-16 22:14:45.

Gram Preview Bot