From: Kristofer Krause Date: Fri, 25 Sep 2015 20:37:52 +0000 (-0400) Subject: nested equalizer unit tests added X-Git-Tag: v5.5.3~12^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F6904%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git nested equalizer unit tests added --- diff --git a/spec/equalizer/equalizer.js b/spec/equalizer/equalizer.js index eee56e5b0..86821de5f 100644 --- a/spec/equalizer/equalizer.js +++ b/spec/equalizer/equalizer.js @@ -22,9 +22,42 @@ describe('equalizer:', function() { var equalized = $('[data-equalizer-watch]'); + expect(equalized.length).toBe(3); + equalized.each(function(){ expect($(this).outerHeight()).toBe(equalized.first().outerHeight()); }); }); }); -}); + + describe('nested basic height', function() { + beforeEach(function() { + document.body.innerHTML = __html__['spec/equalizer/nested.html']; + }); + + it('nested elements should have equal heights on load', function() { + $(document).foundation(); + + var equalized = $('[data-equalizer-watch=bar]'); + + expect(equalized.length).toBe(4); + + equalized.each(function(){ + expect($(this).outerHeight()).toBe(equalized.first().outerHeight()); + }); + }); + + it('parent with nested elements should have equal height with its equalizer on load', function() { + $(document).foundation(); + + var equalized = $('[data-equalizer-watch=foo]'); + + expect(equalized.length).toBe(3); + + equalized.each(function(){ + expect($(this).outerHeight()).toBe(equalized.first().outerHeight()); + }); + }); + + }); +}); \ No newline at end of file diff --git a/spec/equalizer/nested.html b/spec/equalizer/nested.html new file mode 100644 index 000000000..442b536d2 --- /dev/null +++ b/spec/equalizer/nested.html @@ -0,0 +1,31 @@ +
+
+
+

Parent panel

+
+
+ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. +
+
+ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. +
+
+ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. +
+
+ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. +
+
+
+
+
+
+ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. +
+
+
+
+ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. +
+
+
\ No newline at end of file