Skip to content

test(data-drains): cover the migrated detail and create surfaces#5958

Merged
waleedlatif1 merged 1 commit into
stagingfrom
data-drains-tests
Jul 25, 2026
Merged

test(data-drains): cover the migrated detail and create surfaces#5958
waleedlatif1 merged 1 commit into
stagingfrom
data-drains-tests

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #5954. That PR shipped the fullscreen migration with every gate green but nothing ever rendered — so this executes the two new views instead of reasoning about them, and locks the behaviours the migration could have silently dropped.

The first run immediately caught a defect that shipped in #5954: dropping toLowerCase from humanizeConfigKey (a review suggestion, to stop accessKeyId reading as Access key id) left every config label in Title Case — Force Path Style — while the function's own TSDoc still promised Force path style. Now sentence case with initialisms preserved: Force path style, Access key ID, Service account JSON. Fixed here since #5954 was already merged.

What the tests pin down:

  • the detail carries every column the old table showed (source, destination, cadence, last run) and never renders credentials
  • run sizes report sub-kilobyte writes rather than flooring to 0 Bytes, and a 5 GB run stays in GB — both directions of the formatFileSize bug
  • Run now stays disabled while a drain is disabled, matching the old row menu
  • delete leaves the detail only after the request resolves, and stays put + toasts on failure
  • create gates on name plus a complete destination, sends the correct destination branch, trims the name, and toasts on failure
  • every labelled field across all seven destination forms resolves to a real control id, and every select carries an accessible name — the regression from the ChipModalFieldSettingRow migration, now guarded

Type of Change

  • Tests
  • Bug fix (config label casing)

Testing

18 tests across the two new files; full ee/data-drains + lib/data-drains suites, typecheck, and lint:check green.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Executes the two new views rather than reasoning about them, and locks the
behaviours this migration could silently drop:

- the detail carries every column the table used to show (source,
  destination, cadence, last run) and never renders credentials
- run sizes report sub-kilobyte writes instead of flooring to '0 Bytes', and
  a multi-gigabyte run stays in GB
- Run now stays disabled while a drain is disabled, as the row menu did
- delete leaves only after the request resolves, and stays put on failure
- create gates on name plus a complete destination, sends the right
  destination branch, and toasts on failure
- every labelled field in all seven destination forms resolves to a real
  control id, and every select carries an accessible name

The first run caught a defect: dropping toLowerCase from humanizeConfigKey
left keys rendering Title Case ('Force Path Style') while the TSDoc still
promised sentence case. Now sentence case with initialisms preserved —
'Access key ID', 'Service account JSON'.
@vercel

vercel Bot commented Jul 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 25, 2026 3:14am

Request Review

@cursor

cursor Bot commented Jul 25, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Test-only additions plus a display-label formatting fix in the data drain detail UI; no auth, API, or export pipeline behavior changes.

Overview
Adds Vitest/jsdom coverage for the migrated DataDrainCreate and DataDrainDetail flows so list-table metadata, mutations, toasts, and accessibility wiring stay pinned after the fullscreen settings migration.

Create tests gate the primary action on name + complete destination fields, assert trimmed submit payloads and success/error toasts, destination-type field swaps, aria-label on selects, and that every destination form in DESTINATION_FORM_REGISTRY has matching label[for] / control id pairs.

Detail tests lock subtitle/metadata parity with the old table, generic destination config display (no credentials), run byte formatting edge cases, disabled Run now, enable toggle/delete/run/test mutations (including delete-only-navigates-on-success), and placeholder run data showing loading.

Bug fix: humanizeConfigKey in data-drain-detail.tsx now uses sentence case with a small acronym map (ID, URL, JSON, API) so labels read like Force path style and Access key ID instead of Title Case (Force Path Style).

Reviewed by Cursor Bugbot for commit 5aa1632. Configure here.

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 5aa1632. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds comprehensive coverage for the migrated data-drain create and detail views and corrects generic configuration labels to use sentence case while preserving supported initialisms.

  • Tests create-form validation, destination switching, payload construction, error handling, and field accessibility across all destination types.
  • Tests detail metadata, configuration rendering, run-size formatting, action availability, mutations, deletion behavior, and loading states.
  • Updates configuration-key humanization for labels such as Force path style, Project ID, and URL.

Confidence Score: 5/5

The pull request appears safe to merge, with no actionable defects identified in the changed implementation or tests.

The label formatter covers all acronym-bearing keys currently reachable from destination configuration responses, and the added tests exercise the migrated create and detail behavior without introducing a concrete runtime, security, or contract failure.

Important Files Changed

Filename Overview
apps/sim/ee/data-drains/components/data-drain-create.test.tsx Adds focused create-surface tests covering validation, request payloads, destination switching, failures, and accessible control labeling.
apps/sim/ee/data-drains/components/data-drain-detail.test.tsx Adds detail-surface tests covering metadata, safe config rendering, run formatting, actions, mutations, deletion, and loading behavior.
apps/sim/ee/data-drains/components/data-drain-detail.tsx Converts generic configuration labels to sentence case and preserves every initialism used by current destination configuration schemas.

Reviews (1): Last reviewed commit: "test(data-drains): cover the migrated de..." | Re-trigger Greptile

@waleedlatif1
waleedlatif1 merged commit cafc9aa into staging Jul 25, 2026
20 checks passed
@waleedlatif1
waleedlatif1 deleted the data-drains-tests branch July 25, 2026 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant