Skip to content

Add table header, date range, status tag, action item, and scope helpers#47

Merged
senid231 merged 2 commits intomasterfrom
copilot/add-have-fields-date-range-helper
Apr 9, 2026
Merged

Add table header, date range, status tag, action item, and scope helpers#47
senid231 merged 2 commits intomasterfrom
copilot/add-have-fields-date-range-helper

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 8, 2026

Adds a batch of missing DSL helpers for testing Active Admin pages — covering table headers, date range filters, status tags, action item links, table scopes, and sidebar scoping.

New matchers

  • have_fields_date_range(label, from:, to:, exact:) — asserts a filter_date_range input pair exists with expected values
  • have_table_header(text, column:, sortable:, sort_direction:) — asserts a thead > tr > th.col with optional sortable/sort-direction class checks
  • have_action_item_link(title, exact:, href:) — asserts an action item <a> with optional href attribute matching
  • have_status_tag(type, **options) — asserts span.status_tag.<type>

New finders

  • within_table_footer — scopes within tfoot > tr
  • find_table_header(text, options) — returns the matching header node
  • find_action_item(title, exact:) — returns the matching action item node
  • within_action_item_dropdown — scopes within .dropdown_menu_list_wrapper

New actions

  • click_table_scope(text) — clicks a scope tab by exact text
  • click_table_header(text, options) — clicks the sort link inside a header

Updated

  • table_header_selector now accepts optional text, column:, sortable:, sort_direction: — returns a fully qualified thead > tr > th.col.col-<name>[.sortable][.sorted-asc|desc] selector
  • within_sidebar replaced within_panel traversal with direct ancestor('.sidebar_section') lookup — more robust against markup variations
  • have_table_scope gains an optional positional title arg and a selected: keyword, e.g.:
expect(page).to have_table_scope('Active')
expect(page).to have_table_scope('Active', selected: true)
# legacy no-title form still works
expect(page).to have_table_scope(exact_text: 'Active', selected: false)

Copilot AI changed the title [WIP] Add #have_fields_date_range and #within_table_footer helpers Add table header, date range, status tag, action item, and scope helpers Apr 8, 2026
Copilot AI requested a review from senid231 April 8, 2026 13:03
@senid231 senid231 marked this pull request as ready for review April 9, 2026 10:38
@senid231 senid231 merged commit 5f4abf2 into master Apr 9, 2026
73 of 74 checks passed
@senid231 senid231 deleted the copilot/add-have-fields-date-range-helper branch April 9, 2026 13:06
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.

add #have_fields_date_range and #within_table_footer helpers

2 participants