Skip to content

Commit

Permalink
Switch to using have_button matcher
Browse files Browse the repository at this point in the history
Likely more robust, though i didn't actually encounter any
flakiness here. Mostly just addressing the TODO comment.
  • Loading branch information
solebared committed May 31, 2024
1 parent 76e7378 commit a2467d4
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions spec/system/volunteers/index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -305,18 +305,14 @@
pending "is disabled by default"

context "when none is selected" do
it "is enabled" do # TODO: Flaky. Fix this test
it "is enabled" do
visit volunteers_path
find("#supervisor_volunteer_volunteer_ids_#{volunteer.id}").click
find("[data-select-all-target='button']").click
select "None", from: "supervisor_volunteer_supervisor_id"

button = find("[data-disable-form-target='submitButton']")

expect(button.disabled?).to be false
expect(button[:class].include?("deactive-btn")).to be false
expect(button[:class].include?("dark-btn")).to be true
expect(button[:class].include?("btn-hover")).to be true
expect(page).to have_button("Confirm", disabled: false)
expect(page).to have_button("Confirm", class: %w[!deactive-btn dark-btn btn-hover])
end
end

Expand Down

0 comments on commit a2467d4

Please sign in to comment.