@@ -252,58 +252,55 @@ describe('Bootstrap Field Inputs', () => {
252
252
} ) ;
253
253
254
254
} ) ;
255
+
256
+ describe ( 'Select' , ( ) => {
257
+ describe ( 'functions' , ( ) => {
258
+ describeFunctions ( 'select' , 'select' ) ;
259
+ } ) ;
260
+ describe ( 'classes & attributes' , ( ) => {
261
+ describeAttributes ( 'select' , false ) ;
262
+ } ) ;
263
+ describe ( 'conditional elements' , ( ) => {
264
+ describeConditional ( 'select' ) ;
265
+ } ) ;
255
266
267
+ it ( 'layout' , ( ) => {
268
+ data . fields [ 0 ] . type = 'select' ;
269
+ createForm ( data ) ;
256
270
271
+ let inputs = vm . $el . querySelectorAll ( 'select' ) ;
272
+ let input = inputs [ 0 ] ;
257
273
258
- /*
259
- describe('Select', () => {
260
- describe('functions', ()=>{
261
- describeFunctions('select', 'select');
262
- });
263
- describe('classes & attributes', () => {
264
- describeAttributes('select', false);
265
- });
266
- describe('conditional elements', ()=>{
267
- describeConditional('select');
268
- });
269
-
270
- it('layout', () => {
271
- data.form.test.type = 'select';
272
- createForm(data);
273
-
274
- let inputs = vm.$el.querySelectorAll('select');
275
- let input = inputs[0];
276
-
277
- expect(inputs).to.be.length(1);
278
- });
279
-
280
- it('array options', () => {
281
- data.form.test.type = 'select';
282
- data.form.test.options = ['one', 'two', 'three'];
283
- createForm();
284
- let options = vm.$el.querySelectorAll('option');
285
- let option = options[0];
286
- expect(options).to.be.length(3);
287
- expect(option.value).to.equal('one');
288
- expect(option.innerHTML).to.equal('one');
289
- });
274
+ expect ( inputs ) . to . be . length ( 1 ) ;
275
+ } ) ;
290
276
291
- it('object options', () => {
292
- data.form.test.type = 'select';
293
- data.form.test.options = [
294
- { label: 'Foo', value: 'bar' },
295
- { label: 'Bar', value: 'foo' }
296
- ];
297
- createForm();
298
- let options = vm.$el.querySelectorAll('option');
299
- let option = options[0];
300
- expect(options).to.be.length(2);
301
- expect(option.value).to.equal('bar');
302
- expect(option.innerHTML).to.equal('Foo');
303
- });
304
-
305
- });
277
+ it ( 'array options' , ( ) => {
278
+ data . fields [ 0 ] . type = 'select' ;
279
+ data . fields [ 0 ] . options = [ 'one' , 'two' , 'three' ] ;
280
+ createForm ( ) ;
281
+ let options = vm . $el . querySelectorAll ( 'option' ) ;
282
+ let option = options [ 0 ] ;
283
+ expect ( options ) . to . be . length ( 3 ) ;
284
+ expect ( option . value ) . to . equal ( 'one' ) ;
285
+ expect ( option . innerHTML ) . to . equal ( 'one' ) ;
286
+ } ) ;
306
287
288
+ it ( 'object options' , ( ) => {
289
+ data . fields [ 0 ] . type = 'select' ;
290
+ data . fields [ 0 ] . options = [
291
+ { label : 'Foo' , value : 'bar' } ,
292
+ { label : 'Bar' , value : 'foo' }
293
+ ] ;
294
+ createForm ( ) ;
295
+ let options = vm . $el . querySelectorAll ( 'option' ) ;
296
+ let option = options [ 0 ] ;
297
+ expect ( options ) . to . be . length ( 2 ) ;
298
+ expect ( option . value ) . to . equal ( 'bar' ) ;
299
+ expect ( option . innerHTML ) . to . equal ( 'Foo' ) ;
300
+ } ) ;
301
+
302
+ } ) ;
303
+ /*
307
304
describe('Textarea', () => {
308
305
describe('functions', ()=>{
309
306
describeFunctions('textarea', 'textarea');
0 commit comments