});
});
- 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')
});
});
});