Skip to content

Commit

Permalink
Fix flaky spec
Browse files Browse the repository at this point in the history
Running locally this spec failed me quite a few times.

I think it may be because this screen loads a graphic and it seems to take
a while to load (<%= render "admin/stats/graph" ...  %>)

I have run several tests in a row with success when removing this graph
from the view, or when adding a sleep.

It seems that adding the have_css of the chart id also seems to get me
through the spec.
  • Loading branch information
taitus committed Feb 21, 2023
1 parent 4bfea77 commit 89f5e78
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions spec/system/admin/stats_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
click_link "Supporting phase"
end

expect(page).to have_css "#graph"
expect(page).to have_content "VOTES\n3"
expect(page).to have_content "PARTICIPANTS\n2"
expect(page).to have_link "Go back", count: 1
Expand Down

0 comments on commit 89f5e78

Please sign in to comment.