Skip to content

Fix vector coercion - #80

Closed
bolivier wants to merge 1 commit into
mainfrom
fix-vector-coercion
Closed

bolivier wants to merge 1 commit into
mainfrom
fix-vector-coercion

Conversation

@bolivier

@bolivier bolivier commented Feb 13, 2026 •

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

Release Notes

  • New Features

    • Added label-based element selection to identify elements by their associated labels (via for attribute, wrapping labels, aria-label, and aria-labelledby).
    • Introduced ID-based element lookup utility.
    • Enhanced text matching for pattern comparison.
  • Bug Fixes

    • Improved form submission error handling for single-value fields.
  • Tests

    • Added comprehensive test coverage for label-based selection functionality.

@coderabbitai

coderabbitai Bot commented Feb 13, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@bolivier has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 27 minutes and 16 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

The PR extends the rapid-test HTML testing utilities by adding label-based element selectors (get-by-label, get-all-by-label) and utility functions for ID-based and text-based matching. Additionally, form coercion handling in the Tram router is refactored with a new transformer provider to properly coerce single string values into vectors for form submissions.

Changes

Cohort / File(s) Summary
Label-based Selectors
src/main/rapid_test/html/label.clj, src/main/rapid_test/html.clj
New namespace introduced with label association utilities (get-by-label, get-all-by-label) supporting multiple labeling mechanisms (for attribute, wrapping label, aria-label, aria-labelledby). Main html module updated to require and re-export these new label-based selectors.
HTML Testing Utilities
src/main/rapid_test/html/utils.clj
Added find-by-id function for ID-based element lookup and text-match? function for pattern/string matching. Refactored existing matches-options? to use the new text-match? utility.
Label Selector Tests
test/main/rapid_test/html_test.clj
New test suites added for get-by-label and get-all-by-label covering various label association scenarios and edge cases.
Form Coercion Enhancement
src/main/tram/routes.clj
Updated error handling to pass exception objects to handlers. Introduced form-transformer-provider to coerce single string values into vectors for form fields expecting vector submissions, integrated with existing transformers.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

  • Create first html testing utils #78: Introduced the html testing utilities module that this PR extends with new label-based selectors and utilities.
  • Html testing utils #79: Introduced role-based exports (get-by-role, get-all-by-role) that this PR complements with label-based selector alternatives.
  • Merge dev branch #77: Modified the same tram/routes.clj file, both introducing Malli-based coercion patterns and form transformation provider changes.

Poem

🐰 With a hop and a skip through the zipper so deep,
Labels we find where the DOM elements sleep!
By aria or for, we traverse and roam,
New selectors make rapid-test feel like home.
Form coercion transformed, utilities grow,
A rabbit's delight, with a test-driven glow! 🐇✨

🚥 Pre-merge checks | ✅ 2 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'Fix vector coercion' is misleading as the primary changes involve adding label-based selection utilities to rapid-test.html; only one file (tram/routes.clj) addresses vector coercion. Update the title to reflect the main changes, such as 'Add label-based HTML element selection utilities' or 'Add get-by-label utilities and fix vector coercion'.
Merge Conflict Detection ⚠️ Warning ⚠️ Unable to check for merge conflicts: Failed to fetch base branch: From https://github.com/bolivier/tram
! [rejected] main -> main (non-fast-forward)
+ 20a0c92...0e4761d main -> origin/main (forced update)
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-vector-coercion

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

When a string comes in on a field that should be a vector, that string should be
converted into a vector of length 1.
@bolivier
bolivier force-pushed the fix-vector-coercion branch from dbbd0de to d06faac Compare February 13, 2026 22:48
@bolivier bolivier closed this Jul 14, 2026
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