From 2c4b3f9be1b1a54ee1809016e9e5aafd7eb46ae9 Mon Sep 17 00:00:00 2001 From: Marius Olbertz Date: Sat, 30 Dec 2017 23:04:23 +0100 Subject: [PATCH] Added test for fix for #10803. --- test/javascript/components/drilldown.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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, {}); -- 2.47.2