From: Marius Olbertz Date: Sat, 30 Dec 2017 22:04:23 +0000 (+0100) Subject: Added test for fix for #10803. X-Git-Tag: v6.6.0~3^2~326^2 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=refs%2Fpull%2F10829%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Added test for fix for #10803. --- diff --git a/test/javascript/components/drilldown.js b/test/javascript/components/drilldown.js index 69a8e706f..7c13921a1 100644 --- a/test/javascript/components/drilldown.js +++ b/test/javascript/components/drilldown.js @@ -304,6 +304,18 @@ describe('Drilldown Menu', function() { $html.find('> li:nth-child(1) > ul').should.have.class('is-active'); }); + it('focuses parent link if parentLink is true', function(done) { + $html = $(template).appendTo('body'); + plugin = new Foundation.Drilldown($html, {parentLink: true}); + + $html.find('> li:nth-child(1) > a').focus() + .trigger(window.mockKeyboardEvent('ARROW_RIGHT')); + + setTimeout(function() { // Timeout to make sure transition has ended + $html.find('> li:nth-child(1) > ul > li[data-is-parent-link] a')[0].should.be.equal(document.activeElement); + done(); + }, 500); + }); it('closes child element on ARROW_LEFT', function() { $html = $(template).appendTo('body'); plugin = new Foundation.Drilldown($html, {});