File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/grid/columns Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,8 @@ define([
10
10
'use strict' ;
11
11
12
12
describe ( 'Ui/js/grid/columns/select' , function ( ) {
13
- var opts = [ {
13
+ var fieldName = 'selectField' ,
14
+ opts = [ {
14
15
label : 'a' , value : 1
15
16
} , {
16
17
label : 'b' , value : 2
@@ -29,22 +30,27 @@ define([
29
30
select ;
30
31
31
32
beforeEach ( function ( ) {
32
- select = new Select ( ) ;
33
+ select = new Select ( { index : fieldName } ) ;
33
34
} ) ;
34
35
35
36
describe ( 'getLabel method' , function ( ) {
36
37
it ( 'get label while options empty' , function ( ) {
37
- expect ( select . getLabel ( 2 ) ) . toBe ( '' ) ;
38
+ expect ( select . getLabel ( { selectField : '2' } ) ) . toBe ( '' ) ;
38
39
} ) ;
39
40
40
41
it ( 'get label for existed value' , function ( ) {
41
42
select . options = opts ;
42
- expect ( select . getLabel ( 2 ) ) . toBe ( 'b' ) ;
43
+ expect ( select . getLabel ( { selectField : '2' } ) ) . toBe ( 'b' ) ;
43
44
} ) ;
44
45
45
46
it ( 'get label for existed value in case the options are initialized as an object' , function ( ) {
46
47
select . options = optsAsObject ;
47
- expect ( select . getLabel ( 3 ) ) . toBe ( 'c' ) ;
48
+ expect ( select . getLabel ( { selectField : '3' } ) ) . toBe ( 'c' ) ;
49
+ } ) ;
50
+
51
+ it ( 'get labels for existed values in case the options are initialized as an object' , function ( ) {
52
+ select . options = optsAsObject ;
53
+ expect ( select . getLabel ( { selectField : '1,3' } ) ) . toBe ( 'a, c' ) ;
48
54
} ) ;
49
55
} ) ;
50
56
} ) ;
You can’t perform that action at this time.
0 commit comments