]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Added test for fix for #10803. 10829/head
authorMarius Olbertz <marius.olbertz@gmail.com>
Sat, 30 Dec 2017 22:04:23 +0000 (23:04 +0100)
committerMarius Olbertz <marius.olbertz@gmail.com>
Sat, 30 Dec 2017 22:25:04 +0000 (23:25 +0100)
test/javascript/components/drilldown.js

index 69a8e706f9d31cc8a5faf7be643546d471846c28..7c13921a1aa8309d913c2642488f81f546284246 100644 (file)
@@ -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, {});