From d13a6a094688ae95fdb99ebb6e0d00923eb696d8 Mon Sep 17 00:00:00 2001 From: Kevin Ball Date: Wed, 31 May 2017 15:34:15 -0700 Subject: [PATCH] Update dropdown automated tests to work with new positioning --- test/javascript/components/dropdown.js | 31 +++++++------------------- 1 file changed, 8 insertions(+), 23 deletions(-) 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') }); }); }); -- 2.47.2