From 9685cde21ffd9a2f302507902ec4927b2331d393 Mon Sep 17 00:00:00 2001 From: Daniel Ruf Date: Sat, 2 Nov 2019 23:32:33 +0100 Subject: [PATCH] test: fix accordionMenu race condition --- browserstack.json | 4 ++-- test/javascript/components/accordionMenu.js | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/browserstack.json b/browserstack.json index 2a074d4fa..657c50aac 100644 --- a/browserstack.json +++ b/browserstack.json @@ -17,7 +17,7 @@ "ie_10", { "os": "ios", - "os_version": "latest", + "os_version": "12.4", "device": "iPhone XS", "real_mobile": "true" }, @@ -29,7 +29,7 @@ }, { "os": "android", - "os_version": "latest", + "os_version": "9.0", "device": "Google Pixel 3", "real_mobile": "true" }, diff --git a/test/javascript/components/accordionMenu.js b/test/javascript/components/accordionMenu.js index d1f5a8b9e..b59de0d7e 100644 --- a/test/javascript/components/accordionMenu.js +++ b/test/javascript/components/accordionMenu.js @@ -53,16 +53,15 @@ describe('Accordion Menu', function() { // Open it first plugin.down($submenu); - plugin.up($submenu); - - setTimeout(() => { + $html.on('up.zf.accordionMenu', function () { // Should be hidden - $submenu.should.be.hidden; - // Should have attributes updated and without active classe + $submenu.should.be.hidden; // Should have attributes updated and without active classe + $submenu.should.have.attr('aria-hidden', 'true'); $submenu.should.not.have.class('is-active'); done(); - }, 1); + }); + plugin.up($submenu); }); it('toggles attributes of title of the targeted container', function() { -- 2.47.2