]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
test: fix accordionMenu race condition
authorDaniel Ruf <mac1@daniel-ruf.de>
Sat, 2 Nov 2019 22:32:33 +0000 (23:32 +0100)
committerDaniel Ruf <mac1@daniel-ruf.de>
Sat, 2 Nov 2019 22:45:35 +0000 (23:45 +0100)
browserstack.json
test/javascript/components/accordionMenu.js

index 2a074d4fad7567e9c2b5865e06db6fb232efd4d1..657c50aacd376516d5af294ab710c7bfbd093f91 100644 (file)
@@ -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"
         },
index d1f5a8b9e4f58d635d8d40ef11d340f10bdb90e9..b59de0d7ea789c06085980fd982986cb79454811 100644 (file)
@@ -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() {