mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
Feature | Filter on uncategorized transactions (#1359)
* allow filtering uncategorized transactions * user can filter uncategorized transactions test * rubocop linting
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user