mirror of
https://github.com/we-promise/sure.git
synced 2026-04-18 11:34:13 +00:00
Add exchange rate feature with multi-currency transactions and transfers support (#1099)
Co-authored-by: Pedro J. Aramburu <pedro@joakin.dev>
This commit is contained in:
committed by
GitHub
parent
8e81e967fc
commit
f699660479
@@ -65,4 +65,18 @@ class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
|
||||
yield
|
||||
end
|
||||
end
|
||||
|
||||
# Interact with DS::Select custom dropdown components.
|
||||
# DS::Select renders as a button + listbox — not a native <select> — so
|
||||
# Capybara's built-in `select(value, from:)` does not work with it.
|
||||
def select_ds(label_text, record)
|
||||
field_label = find("label", exact_text: label_text)
|
||||
container = field_label.ancestor("div.relative")
|
||||
container.find("button").click
|
||||
if container.has_selector?("input[type='search']", visible: true)
|
||||
container.find("input[type='search']", visible: true).set(record.name)
|
||||
end
|
||||
listbox = container.find("[role='listbox']", visible: true)
|
||||
listbox.find("[role='option'][data-value='#{record.id}']", visible: true).click
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user