From: Matt Scheurich Date: Tue, 5 Sep 2017 12:19:38 +0000 (+0200) Subject: added external href test for tabs X-Git-Tag: v6.6.0~3^2~332^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c138ca1503a5018ba9a79450d652b43b75bbd78b;p=thirdparty%2Ffoundation%2Ffoundation-sites.git added external href test for tabs --- diff --git a/test/javascript/components/tabs.js b/test/javascript/components/tabs.js index 1d4157ea4..f0a06c4fd 100644 --- a/test/javascript/components/tabs.js +++ b/test/javascript/components/tabs.js @@ -78,6 +78,7 @@ describe('Tabs', function() { plugin.selectTab('#panel2'); $html.find('#panel2').should.be.visible; }); + it('opens the selected tab with data-tabs-target attribute', function() { $html = $(template).appendTo('body'); plugin = new Foundation.Tabs($html.find('[data-tabs]'), {}); @@ -85,6 +86,36 @@ describe('Tabs', function() { plugin.selectTab('#/panel3'); $html.find('#panel3').should.be.visible; }); + + it('opens the selected tab with data-tabs-target attribute and external href', function () { + $html = $(` +
+ + +
+
+

one

+

Check me out! I'm a super cool Tab panel with text content!

+
+
+

two

+

Check me out! I'm a super cool Tab panel with text content!

+
+
+

three

+

Check me out! I'm a super cool Tab panel with text content!

+
+
+
`).appendTo('body'); + plugin = new Foundation.Tabs($html.find('[data-tabs]'), {}); + + plugin.selectTab('#panel3'); + $html.find('#panel3').should.be.visible; + }) }); describe('_handleTabChange()', function() {