mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 15:49:39 +02:00
Feature | Filter on uncategorized transactions (#1359)
* allow filtering uncategorized transactions * user can filter uncategorized transactions test * rubocop linting
This commit is contained in:
parent
aa3342b0dc
commit
2cc89195bf
4 changed files with 43 additions and 3 deletions
|
@ -6,7 +6,7 @@ class TransactionsTest < ApplicationSystemTestCase
|
|||
|
||||
Account::Entry.delete_all # clean slate
|
||||
|
||||
create_transaction("one", 12.days.ago.to_date, 100)
|
||||
@uncategorized_transaction = create_transaction("one", 12.days.ago.to_date, 100)
|
||||
create_transaction("two", 10.days.ago.to_date, 100)
|
||||
create_transaction("three", 9.days.ago.to_date, 100)
|
||||
create_transaction("four", 8.days.ago.to_date, 100)
|
||||
|
@ -61,6 +61,30 @@ class TransactionsTest < ApplicationSystemTestCase
|
|||
end
|
||||
end
|
||||
|
||||
test "can filter uncategorized transactions" do
|
||||
find("#transaction-filters-button").click
|
||||
|
||||
within "#transaction-filters-menu" do
|
||||
click_button "Category"
|
||||
check("Uncategorized")
|
||||
click_button "Apply"
|
||||
end
|
||||
|
||||
assert_selector "#" + dom_id(@uncategorized_transaction), count: 1
|
||||
assert_no_selector("#" + dom_id(@transaction))
|
||||
|
||||
find("#transaction-filters-button").click
|
||||
|
||||
within "#transaction-filters-menu" do
|
||||
click_button "Category"
|
||||
check(@transaction.account_transaction.category.name)
|
||||
click_button "Apply"
|
||||
end
|
||||
|
||||
assert_selector "#" + dom_id(@transaction), count: 1
|
||||
assert_selector "#" + dom_id(@uncategorized_transaction), count: 1
|
||||
end
|
||||
|
||||
test "all filters work and empty state shows if no match" do
|
||||
find("#transaction-filters-button").click
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue