|
87 | 87 | optgroupValueField: 'val',
|
88 | 88 | optgroupField: 'grp',
|
89 | 89 | disabledField: 'dis'
|
90 |
| - }); |
| 90 | + }); |
91 | 91 | assert.deepEqual(test.selectize.options, {
|
92 |
| - 'a': {text: 'Item A', value: 'a', grp: ['Group 1', 'Group 2'], $order: 1, dis: false}, |
93 |
| - 'b': {text: 'Item B', value: 'b', grp: ['Group 1', 'Group 2'], $order: 2, dis: false} |
| 92 | + 'a': {text: 'Item A', value: 'a', grp: ['Group 1', 'Group 2'], $order: 1, dis: false, styles: '', classes: ''}, |
| 93 | + 'b': {text: 'Item B', value: 'b', grp: ['Group 1', 'Group 2'], $order: 2, dis: false, styles: '', classes: ''} |
94 | 94 | });
|
95 | 95 | assert.deepEqual(test.selectize.optgroups, {
|
96 | 96 | 'Group 1': {label: 'Group 1', val: 'Group 1', $order: 3, dis: false},
|
|
111 | 111 | optgroupValueField: 'val',
|
112 | 112 | optgroupField: 'grp',
|
113 | 113 | disabledField: 'dis'
|
114 |
| - }); |
| 114 | + }); |
115 | 115 | assert.deepEqual(test.selectize.options, {
|
116 |
| - 'a': {text: 'Item A', value: 'a', grp: ['Group 1', 'Group 2'], $order: 1, dis: true}, |
117 |
| - 'b': {text: 'Item B', value: 'b', grp: ['Group 1', 'Group 2'], $order: 2, dis: false} |
| 116 | + 'a': {text: 'Item A', value: 'a', grp: ['Group 1', 'Group 2'], $order: 1, dis: true, styles: '', classes: ''}, |
| 117 | + 'b': {text: 'Item B', value: 'b', grp: ['Group 1', 'Group 2'], $order: 2, dis: false, styles: '', classes: ''} |
118 | 118 | });
|
119 | 119 | assert.deepEqual(test.selectize.optgroups, {
|
120 | 120 | 'Group 1': {label: 'Group 1', val: 'Group 1', $order: 3, dis: false},
|
|
210 | 210 | expect(test.selectize.$dropdown.find('[data-selectable]')).to.has.length(1);
|
211 | 211 | done();
|
212 | 212 | }, 0);
|
213 |
| - }); |
| 213 | + }); |
| 214 | + it('should respect option style / class', function () { |
| 215 | + var test; |
| 216 | + |
| 217 | + beforeEach(function() { |
| 218 | + test = setup_test('<select>' + |
| 219 | + '<option value="a" style="color:red;" class="a">A</option>' + |
| 220 | + '</select>', { |
| 221 | + dropdownSize: { sizeType: 'fixedHeight', sizeValue: 100 } |
| 222 | + }); |
| 223 | + }); |
| 224 | + |
| 225 | + it('should dropdown height to be equal 100', function(done) { |
| 226 | + test.selectize.focus(); |
| 227 | + |
| 228 | + window.setTimeout(function () { |
| 229 | + expect(test.selectize.$dropdown_content.find('.option').attr('style')).to.be.equal('color:red;'); |
| 230 | + expect(test.selectize.$dropdown_content.find('.option').hasClass('a')).to.be.equal(true); |
| 231 | + }, 0); |
| 232 | + }); |
| 233 | + }); |
214 | 234 | describe('getValue()', function() {
|
215 | 235 | it('should return "" when empty', function() {
|
216 | 236 | var test = setup_test('<select>', {});
|
|
0 commit comments