1
1
/**
2
- * Copyright © Magento, Inc . All rights reserved.
2
+ * Copyright © 2016 Magento . All rights reserved.
3
3
* See COPYING.txt for license details.
4
4
*/
5
5
/*eslint max-nested-callbacks: 0*/
@@ -10,47 +10,57 @@ define([
10
10
'use strict' ;
11
11
12
12
describe ( 'Ui/js/grid/columns/select' , function ( ) {
13
- var fieldName = 'selectField' ,
14
- opts = [ {
15
- label : 'a' , value : 1
13
+ var fieldName = 'selectField' ,
14
+ opts = [ {
15
+ label : 'a' , value : 1
16
16
} , {
17
- label : 'b' , value : 2
17
+ label : 'b' , value : 2
18
18
} ] ,
19
19
optsAsObject = {
20
- 1 : {
21
- label : 'a' , value : 1
20
+ 1 : {
21
+ label : 'a' , value : 1
22
22
} ,
23
- 2 : {
24
- label : 'b' , value : 2
23
+ 2 : {
24
+ label : 'b' , value : 2
25
25
} ,
26
- 4 : {
27
- label : 'c' , value : 3
26
+ 4 : {
27
+ label : 'c' , value : 3
28
28
}
29
29
} ,
30
30
select ;
31
31
32
32
beforeEach ( function ( ) {
33
- select = new Select ( { index : fieldName } ) ;
33
+ select = new Select ( {
34
+ index : fieldName
35
+ } ) ;
34
36
} ) ;
35
37
36
38
describe ( 'getLabel method' , function ( ) {
37
39
it ( 'get label while options empty' , function ( ) {
38
- expect ( select . getLabel ( { selectField : '2' } ) ) . toBe ( '' ) ;
40
+ expect ( select . getLabel ( {
41
+ selectField : '2'
42
+ } ) ) . toBe ( '' ) ;
39
43
} ) ;
40
44
41
- it ( 'get label for existing value' , function ( ) {
45
+ it ( 'get label for existed value' , function ( ) {
42
46
select . options = opts ;
43
- expect ( select . getLabel ( { selectField : '2' } ) ) . toBe ( 'b' ) ;
47
+ expect ( select . getLabel ( {
48
+ selectField : '2'
49
+ } ) ) . toBe ( 'b' ) ;
44
50
} ) ;
45
51
46
- it ( 'get label for existing value in case the options are initialized as an object' , function ( ) {
52
+ it ( 'get label for existed value in case the options are initialized as an object' , function ( ) {
47
53
select . options = optsAsObject ;
48
- expect ( select . getLabel ( { selectField : '3' } ) ) . toBe ( 'c' ) ;
54
+ expect ( select . getLabel ( {
55
+ selectField : '3'
56
+ } ) ) . toBe ( 'c' ) ;
49
57
} ) ;
50
58
51
- it ( 'get labels for existing values in case the options are initialized as an object' , function ( ) {
59
+ it ( 'get labels for existed values in case the options are initialized as an object' , function ( ) {
52
60
select . options = optsAsObject ;
53
- expect ( select . getLabel ( { selectField : '1,3' } ) ) . toBe ( 'a, c' ) ;
61
+ expect ( select . getLabel ( {
62
+ selectField : '1,3'
63
+ } ) ) . toBe ( 'a, c' ) ;
54
64
} ) ;
55
65
} ) ;
56
66
} ) ;
0 commit comments