Skip to content

Commit

Permalink
Merge pull request #2561 from alphagov/fix-flakey-test
Browse files Browse the repository at this point in the history
Fix flakey test due to Javascript animation timing
  • Loading branch information
mtaylorgds authored Mar 4, 2025
2 parents 97eee14 + 12eeb3d commit 3dc19ba
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions test/integration/host_content_update_history_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,25 +97,29 @@ class HostContentUpdateHistoryTest < LegacyJavascriptIntegrationTest

click_on "Edition 2"
within "#version2" do
within page.all(".action-content-block-update")[0] do
assert page.has_content?(Time.zone.parse(@edition2_content_update_event_2["created_at"]).to_fs(:govuk_date))
assert page.has_content?("Content block updated by User 1")
assert page.has_content?("Email address updated")
end

within page.all(".action-content-block-update")[1] do
assert page.has_content?(Time.zone.parse(@edition2_content_update_event_1["created_at"]).to_fs(:govuk_date))
assert page.has_content?("Content block updated by User 2")
assert page.has_content?("Email address updated")
within ".collapse.in" do
within page.all(".action-content-block-update")[0] do
assert page.has_content?(Time.zone.parse(@edition2_content_update_event_2["created_at"]).to_fs(:govuk_date))
assert page.has_content?("Content block updated by User 1")
assert page.has_content?("Email address updated")
end

within page.all(".action-content-block-update")[1] do
assert page.has_content?(Time.zone.parse(@edition2_content_update_event_1["created_at"]).to_fs(:govuk_date))
assert page.has_content?("Content block updated by User 2")
assert page.has_content?("Email address updated")
end
end
end

click_on "Edition 1"
within "#version1" do
within ".action-content-block-update" do
assert page.has_content?(Time.zone.parse(@edition1_content_update_event["created_at"]).to_fs(:govuk_date))
assert page.has_content?("Content block updated by User 1")
assert page.has_content?("Email address updated")
within ".collapse.in" do
within ".action-content-block-update" do
assert page.has_content?(Time.zone.parse(@edition1_content_update_event["created_at"]).to_fs(:govuk_date))
assert page.has_content?("Content block updated by User 1")
assert page.has_content?("Email address updated")
end
end
end
end
Expand Down

0 comments on commit 3dc19ba

Please sign in to comment.