From 6036390a34eab121a9331bb81935891f1f54ec55 Mon Sep 17 00:00:00 2001 From: Daniel Ruf Date: Sat, 2 Nov 2019 23:57:15 +0100 Subject: [PATCH] test: fix offcanvas race condition --- test/javascript/components/offcanvas.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/javascript/components/offcanvas.js b/test/javascript/components/offcanvas.js index d688047b5..34571ba89 100644 --- a/test/javascript/components/offcanvas.js +++ b/test/javascript/components/offcanvas.js @@ -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 -- 2.47.2