1
0
Fork 0
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:
bruno costanzo 2024-10-25 15:37:05 +02:00 committed by GitHub
parent aa3342b0dc
commit 2cc89195bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 43 additions and 3 deletions

View file

@ -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