From 447a873e5c757cf43eae6ae008eadab64c3e0c33 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 7 Jul 2020 00:23:43 +0200 Subject: [PATCH] Fix flaky embedded spec The new cart sidebar takes 300ms to animate in. If we try to click the button on the left during this time, we may click the button on the right as it slides in. --- spec/support/request/ui_component_helper.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/support/request/ui_component_helper.rb b/spec/support/request/ui_component_helper.rb index dd2f38bd46..1230517d38 100644 --- a/spec/support/request/ui_component_helper.rb +++ b/spec/support/request/ui_component_helper.rb @@ -67,6 +67,7 @@ module UIComponentHelper def toggle_cart page.find("#cart").click + sleep 0.3 # Allow 300ms for sidebar animation to finish end def wait_for_ajax