mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 19:39:30 +08:00
DEV: Ensure browser network conditions is reset in system tests (#22404)
Why this change? By ensuring the reset happens in an `ensure` code block, we ensure that the code will always be run even if code fails or an error is raised. This helps to prevent leaking custom network condition states and improves the stability of our system tests.
This commit is contained in:

committed by
GitHub

parent
134dcdd63a
commit
454a4af0bf
@ -142,7 +142,7 @@ RSpec.describe "Chat composer", type: :system do
|
||||
|
||||
expect(page).to have_css(".chat-composer-upload--in-progress")
|
||||
expect(page).to have_css(".chat-composer.is-send-disabled")
|
||||
|
||||
ensure
|
||||
page.driver.browser.network_conditions = { latency: 0 }
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user