mirror of
https://github.com/discourse/discourse.git
synced 2026-08-19 01:14:56 -05:00
FIX: disables send btn while uploads in progress (#21298)
Before this fix you could press send while upload was in progress and lose it as it was not yet uploaded.
This commit is contained in:
@@ -336,4 +336,28 @@ RSpec.describe "Chat composer", type: :system, js: true do
|
||||
expect(page).to have_css(".chat-composer.is-send-disabled")
|
||||
end
|
||||
end
|
||||
|
||||
context "when upload is in progress" do
|
||||
before do
|
||||
channel_1.add(current_user)
|
||||
sign_in(current_user)
|
||||
end
|
||||
|
||||
it "doesn’t allow to send" do
|
||||
chat.visit_channel(channel_1)
|
||||
|
||||
page.driver.browser.network_conditions = { latency: 20_000 }
|
||||
|
||||
file_path = file_from_fixtures("logo.png", "images").path
|
||||
attach_file(file_path) do
|
||||
channel.open_action_menu
|
||||
channel.click_action_button("chat-upload-btn")
|
||||
end
|
||||
|
||||
expect(page).to have_css(".chat-composer-upload--in-progress")
|
||||
expect(page).to have_css(".chat-composer.is-send-disabled")
|
||||
|
||||
page.driver.browser.network_conditions = { latency: 0 }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user