mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 20:14:08 +00:00
Stock filter (#1376)
* Initial pass at stock filtering * Rough in filter * Cleaning up security listing * Tweak to search function * Combobox tweaks * Clean up search query * Update trades test with combobox * Update securities.yml
This commit is contained in:
@@ -16,7 +16,8 @@ class TradesTest < ApplicationSystemTestCase
|
||||
|
||||
open_new_trade_modal
|
||||
|
||||
fill_in "Ticker symbol", with: "NVDA"
|
||||
fill_in "Ticker symbol", with: "AAPL"
|
||||
select_combobox_option("Apple")
|
||||
fill_in "Date", with: Date.current
|
||||
fill_in "Quantity", with: shares_qty
|
||||
fill_in "account_entry[price]", with: 214.23
|
||||
@@ -27,7 +28,7 @@ class TradesTest < ApplicationSystemTestCase
|
||||
|
||||
within_trades do
|
||||
assert_text "Purchase 10 shares of AAPL"
|
||||
assert_text "Buy #{shares_qty} shares of NVDA"
|
||||
assert_text "Buy #{shares_qty} shares of AAPL"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -38,6 +39,7 @@ class TradesTest < ApplicationSystemTestCase
|
||||
|
||||
select "Sell", from: "Type"
|
||||
fill_in "Ticker symbol", with: aapl.ticker
|
||||
select_combobox_option(aapl.security.name)
|
||||
fill_in "Date", with: Date.current
|
||||
fill_in "Quantity", with: aapl.qty
|
||||
fill_in "account_entry[price]", with: 215.33
|
||||
@@ -64,4 +66,10 @@ class TradesTest < ApplicationSystemTestCase
|
||||
def visit_account_trades
|
||||
visit account_url(@account, tab: "transactions")
|
||||
end
|
||||
|
||||
def select_combobox_option(text)
|
||||
within "#account_entry_ticker-hw-listbox" do
|
||||
find("li", text: text).click
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user