From: Nicolas Coden Date: Tue, 31 Jul 2018 22:24:36 +0000 (+0200) Subject: test: check the Drilldrown wrapper height instead of the element height X-Git-Tag: v6.6.0~3^2~124^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7f7dfd83a;p=thirdparty%2Ffoundation%2Ffoundation-sites.git test: check the Drilldrown wrapper height instead of the element height Test the dynamic height of the wrapper instead of the static height of the element (data-drilldrown inside the wrapper). --- diff --git a/test/javascript/components/drilldown.js b/test/javascript/components/drilldown.js index 9d805a7a1..f8f8bd868 100644 --- a/test/javascript/components/drilldown.js +++ b/test/javascript/components/drilldown.js @@ -230,23 +230,25 @@ describe('Drilldown Menu', function() { describe('toggle events', function () { this.timeout(0); - var $trigger, $target, $menu, togglerPlugin; + var $trigger, $target, $wrapper, togglerPlugin; beforeEach(function () { $html = $(templateWithToggler).appendTo('body'); $trigger = $html.find('#trigger'); $target = $html.find('#target'); - $menu = $html.find('#m1'); + $target = $html.find('#target'); togglerPlugin = new Foundation.Toggler($target, {}); - plugin = new Foundation.Drilldown($menu, {}); + plugin = new Foundation.Drilldown($html.find('[data-drilldown]'), { autoHeight: true }); + + $wrapper = $html.find('.is-drilldown'); }); it('correctly resize when opened', function () { // Open the Drilldown $trigger.focus().trigger('click'); - $menu.height().should.be.within(110, 120); + $wrapper.height().should.be.within(110, 120); }); it('correctly resize when closed', function () { @@ -254,7 +256,7 @@ describe('Drilldown Menu', function() { $trigger.focus().trigger('click'); $trigger.focus().trigger('click'); - $menu.height().should.be.equal(0); + $wrapper.height().should.be.equal(0); }); afterEach(function () {