File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
dev/tests/js/jasmine/tests/app/code/Magento/ConfigurableProduct/view/frontend/js Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -9,17 +9,31 @@ define([
9
9
] , function ( $ , Configurable ) {
10
10
'use strict' ;
11
11
12
- var widget ;
12
+ var widget ,
13
+ option = '<select name=\'super_attribute[93]\'' +
14
+ 'data-selector=\'super_attribute[93]\'' +
15
+ 'data-validate=\'{required:true}\'' +
16
+ 'id=\'attribute93\'' +
17
+ 'class=\'super-attribute-select\'>' +
18
+ '<option value=\'\'></option>' +
19
+ '</select>' ,
20
+ selectElement = $ ( option ) ;
13
21
14
22
beforeEach ( function ( ) {
15
23
widget = new Configurable ( ) ;
16
24
widget . options = {
17
25
spConfig : {
26
+ chooseText : 'Chose an Option...' ,
18
27
attributes :
19
28
{
20
29
'size' : {
21
30
options : $ ( '<div><p class="2"></p></div>' )
22
31
}
32
+ } ,
33
+ prices : {
34
+ finalPrice : {
35
+ amount : 12
36
+ }
23
37
}
24
38
} ,
25
39
values : {
@@ -34,5 +48,13 @@ define([
34
48
widget . _parseQueryParams ( 'http://magento.com/product?color=red&size=2' ) ;
35
49
expect ( widget . options . values . size ) . toBe ( '2' ) ;
36
50
} ) ;
51
+
52
+ it ( 'check if attribute value is possible to be set as option with "please select option"' , function ( ) {
53
+ expect ( $ . mage . configurable ) . toBeDefined ( ) ;
54
+ widget . _fillSelect ( selectElement [ 0 ] ) ;
55
+ expect ( selectElement [ 0 ] . options [ 0 ] . innerHTML ) . toBe ( widget . options . spConfig . chooseText ) ;
56
+ widget . _parseQueryParams ( 'http://magento.com/product?color=red&size=2' ) ;
57
+ expect ( widget . options . values . size ) . toBe ( '2' ) ;
58
+ } ) ;
37
59
} ) ;
38
60
} ) ;
You can’t perform that action at this time.
0 commit comments