mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
fix: fix tests
This commit is contained in:
@@ -82,7 +82,9 @@ class ReportsControllerTest < ActionDispatch::IntegrationTest
|
||||
get reports_path(period_type: :monthly)
|
||||
assert_response :ok
|
||||
assert_select "h2", text: I18n.t("reports.trends.title")
|
||||
assert_select "th", text: I18n.t("reports.trends.month")
|
||||
assert_select '[role="columnheader"]' do
|
||||
assert_select "div", text: I18n.t("reports.trends.month")
|
||||
end
|
||||
end
|
||||
|
||||
test "index handles invalid date parameters gracefully" do
|
||||
@@ -236,6 +238,12 @@ class ReportsControllerTest < ActionDispatch::IntegrationTest
|
||||
|
||||
get reports_path(period_type: :monthly)
|
||||
assert_response :ok
|
||||
assert_select "table.w-full"
|
||||
|
||||
# Parent category
|
||||
assert_select "div[data-category='category-#{parent_category.id}']", text: /^Entertainment/
|
||||
|
||||
# Subcategories
|
||||
assert_select "div[data-category='category-#{subcategory_movies.id}']", text: /^Movies/
|
||||
assert_select "div[data-category='category-#{subcategory_games.id}']", text: /^Games/
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user