Make "select all/none" tests actually test something

Since we were on the "Pending review" filter, and there were no records
pending review, the code checking all checkboxes were checked/unchecked
didn't test anything because there were no checkboxes on the page.

So we're clicking on the "All" filter first.
This commit is contained in:
Javi Martín
2024-04-12 17:28:01 +02:00
parent 26a43ee0d2
commit f8f4054614
5 changed files with 15 additions and 0 deletions

View File

@@ -108,6 +108,9 @@ describe "Moderate budget investments" do
create_list(:budget_investment, 2, heading: heading, author: create(:user))
visit moderation_budget_investments_path
within(".menu.simple") { click_link "All" }
expect(page).to have_field type: :checkbox, count: 3
within(".js-check") { click_link "All" }

View File

@@ -128,6 +128,9 @@ describe "Moderate comments" do
create_list(:comment, 2)
visit moderation_comments_path
within(".menu.simple") { click_link "All" }
expect(page).to have_field type: :checkbox, count: 2
within(".js-check") { click_link "All" }

View File

@@ -97,6 +97,9 @@ describe "Moderate debates" do
create_list(:debate, 2)
visit moderation_debates_path
within(".menu.simple") { click_link "All" }
expect(page).to have_field type: :checkbox, count: 2
within(".js-check") { click_link "All" }

View File

@@ -108,6 +108,9 @@ describe "Moderate proposal notifications" do
create_list(:proposal_notification, 2)
visit moderation_proposal_notifications_path
within(".menu.simple") { click_link "All" }
expect(page).to have_field type: :checkbox, count: 2
within(".js-check") { click_link "All" }

View File

@@ -96,6 +96,9 @@ describe "Moderate proposals" do
create_list(:proposal, 2)
visit moderation_proposals_path
within(".menu.simple") { click_link "All" }
expect(page).to have_field type: :checkbox, count: 3
within(".js-check") { click_link "All" }