From dacb605e98c54f91830c56d8dbe9ade4eb79f23e Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Wed, 10 May 2023 00:33:40 +0200 Subject: [PATCH] DEV: more resilient upload spec (#21462) Checking "uploading" string is tricky because it both takes time before showing, and when it will show it will show for a short period of time. I prefer to reduce the surface tested here while still getting some confidence out of it and making the test more reliable. --- plugins/chat/spec/system/uploads_spec.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plugins/chat/spec/system/uploads_spec.rb b/plugins/chat/spec/system/uploads_spec.rb index ab9339efbea..0fc904b1fbc 100644 --- a/plugins/chat/spec/system/uploads_spec.rb +++ b/plugins/chat/spec/system/uploads_spec.rb @@ -64,10 +64,7 @@ describe "Uploading files in chat messages", type: :system, js: true do # image processing clientside is slow! here we are waiting for processing # to complete then the upload to complete as well - using_wait_time(10) do - expect(find(".chat-composer-upload")).to have_content("Uploading") - expect(page).to have_css(".chat-composer-upload .preview .preview-img") - end + expect(page).to have_css(".chat-composer-upload .preview .preview-img", wait: 25) channel.send_message("upload testing")