[OP-19453] Add spec coverage for filter input forms - #23489
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds RSpec coverage for the advanced filter input form classes used by Filters::FilterFormComponent, asserting the rendered DOM structure, key Stimulus/data-* attributes, and operator/value wiring across different filter input types.
Changes:
- Added a shared rendered-form context + shared examples for common filter-row expectations.
- Added form specs for
TextForm,ListForm,DateForm,BooleanForm, andAutocompleteForm. - Added a spec for
AddFilterFormcovering option rendering and disabling active filters.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| spec/support/forms/rendered_filter_input_form.rb | Shared context + shared examples for rendering filter input forms in a Primer form and asserting common row/operator behavior. |
| spec/forms/filters/inputs/text_form_spec.rb | Verifies text vs numeric rendering and naming/value behavior for TextForm. |
| spec/forms/filters/inputs/list_form_spec.rb | Verifies list filter renders the autocompleter wrapper/options and merges additional autocomplete options. |
| spec/forms/filters/inputs/date_form_spec.rb | Verifies operator-dependent date input variants and visibility/hidden handling. |
| spec/forms/filters/inputs/boolean_form_spec.rb | Verifies segmented control rendering and the (hidden) operator select behavior for boolean filters. |
| spec/forms/filters/inputs/autocomplete_form_spec.rb | Verifies autocomplete-backed filters render as multiple autocompleters with expected wrapper attributes. |
| spec/forms/filters/inputs/add_filter_form_spec.rb | Verifies add-filter select rendering, prompt, option listing, and disabling active filters. |
myabc
force-pushed
the
code-maintenance/75446-filters-form-component-rework
branch
2 times, most recently
from
June 2, 2026 17:01
f6700cc to
a9742d0
Compare
myabc
force-pushed
the
code-maintenance/SDS-699-filters-form-specs
branch
from
June 2, 2026 17:43
5d4dd07 to
cb476df
Compare
Adds 47 specs across 6 form classes and a shared context. Covers TextForm, ListForm, DateForm, BooleanForm, AutocompleteForm, and AddFilterForm with assertions on rendered structure, data attributes, and operator routing. https://community.openproject.org/wp/OP-19453
Covers the SegmentedControl DSL input behind boolean filter rows: label and button rendering, the hidden value field, value defaulting to the first item, and wrapper data attributes.
Covers BaseFilterForm's shared row contract directly via a throwaway concrete subclass: row data attributes, the operator select with its data-no-value branch, label targeting, hidden-when-inactive, the delete button, hiding the operator select for a boolean filter, and the abstract add_operand raising SubclassResponsibilityError.
myabc
force-pushed
the
code-maintenance/SDS-699-filters-form-specs
branch
from
June 2, 2026 17:52
cb476df to
2d2b97e
Compare
myabc
marked this pull request as ready for review
June 2, 2026 17:55
oliverguenther
approved these changes
Jun 3, 2026
Base automatically changed from
code-maintenance/75446-filters-form-component-rework
to
dev
June 3, 2026 13:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR is based on #23488. Please review/merge that PR first.
Ticket
https://community.openproject.org/wp/OP-19453
What are you trying to accomplish?
Backfills spec coverage for the filter input form layer. Covers the per-type filter inputs (text, list, date, boolean, autocomplete) and the "add filter" select through a shared render context, the
FilterFormComponentwrapper (controller wrapping, hidden input, output format, system-argument merging), theSegmentedControlform DSL input behind boolean rows, and the sharedBaseFilterFormrow contract.Screenshots
No visual changes.
What approach did you choose and why?
Specs render through the existing Primer form-DSL test harnesses and assert on accessible roles/names and semantic attributes rather than CSS, so they track behaviour rather than markup.
BaseFilterFormis exercised directly via a throwaway concrete subclass so the abstract base's shared row logic is covered in one place instead of only transitively through each subclass.Merge checklist