]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
test: fix offcanvas race condition 11901/head
authorDaniel Ruf <mac1@daniel-ruf.de>
Sat, 2 Nov 2019 22:57:15 +0000 (23:57 +0100)
committerDaniel Ruf <mac1@daniel-ruf.de>
Sat, 2 Nov 2019 23:03:32 +0000 (00:03 +0100)
test/javascript/components/offcanvas.js

index d688047b5da52600eb283a19d6f5cd276dc2f7e8..34571ba891eec9f1482d7e87b032df3990629772 100644 (file)
@@ -302,14 +302,14 @@ describe('Off Canvas', function() {
       $html = $(template).appendTo('body');
       plugin = new Foundation.OffCanvas($html.find('[data-off-canvas]'), {});
 
-      $html.one('opened.zf.offCanvas', function() {
-        plugin.$element.focus()
-          .trigger(window.mockKeyboardEvent('ESCAPE'));
-
-        plugin.$element.should.not.have.class('is-open');
+      $html.one('openedEnd.zf.offCanvas', function() {
         $html.one('closed.zf.offCanvas', function () {
+          plugin.$element.should.not.have.class('is-open');
           done();
         });
+
+        plugin.$element.focus()
+          .trigger(window.mockKeyboardEvent('ESCAPE'));
       });
 
       // Open it first