From: Kevin Ball Date: Wed, 31 May 2017 22:34:15 +0000 (-0700) Subject: Update dropdown automated tests to work with new positioning X-Git-Tag: v6.4.0-rc1~19^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F10053%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Update dropdown automated tests to work with new positioning --- diff --git a/test/javascript/components/dropdown.js b/test/javascript/components/dropdown.js index ee0da373e..6a7e029fc 100644 --- a/test/javascript/components/dropdown.js +++ b/test/javascript/components/dropdown.js @@ -56,40 +56,25 @@ describe('Dropdown', function() { }); }); - describe('getPositionClass()', function() { - it('has no orientation', function() { + describe('inferred positioning', function() { + it('default orientation should be bottom', function() { $dropdownController = $(getDropdownController()).appendTo('body'); $dropdownContainer = $(getDropdownContainer()).appendTo('body'); plugin = new Foundation.Dropdown($dropdownContainer, {}); - plugin.getPositionClass().trim().should.equal(''); + plugin.open() + plugin.position.should.equal('bottom'); }); - it('has vertical position', function() { - $dropdownController = $(getDropdownController()).appendTo('body'); - $dropdownContainer = $(getDropdownContainer('custom-style-before bottom custom-style-after')) - .appendTo('body'); - plugin = new Foundation.Dropdown($dropdownContainer, {}); - - plugin.getPositionClass().trim().should.equal('bottom'); - }); - - it('has horizontal position', function() { + it('gets right alignment from float-right', function() { $dropdownController = $(getDropdownController('custom-style-before float-right custom-style-after')) .appendTo('body'); $dropdownContainer = $(getDropdownContainer()).appendTo('body'); plugin = new Foundation.Dropdown($dropdownContainer, {}); - plugin.getPositionClass().trim().should.equal('right'); - }); - - it('has horizontal position and only one class', function() { - $dropdownController = $(getDropdownController('float-right')) - .appendTo('body'); - $dropdownContainer = $(getDropdownContainer()).appendTo('body'); - plugin = new Foundation.Dropdown($dropdownContainer, {}); - - plugin.getPositionClass().trim().should.equal('right'); + plugin.open() + plugin.position.should.equal('bottom') + plugin.alignment.should.equal('right') }); }); });