File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed
app/code/Magento/Ui/view/base/web/js/form/element
dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,8 @@ define([
55
55
linkSettingsArray . name = baseLinkType . namePrefix + linkName ;
56
56
linkSettingsArray . dataScope = baseLinkType . dataScopePrefix + linkName ;
57
57
linkSettingsArray . type = linkName ;
58
+ linkSettingsArray . disabled = config . disabled ;
59
+ linkSettingsArray . visible = config . visible ;
58
60
processedLinkTypes [ linkName ] = { } ;
59
61
_ . extend ( processedLinkTypes [ linkName ] , baseLinkType , linkSettingsArray ) ;
60
62
} ) ;
Original file line number Diff line number Diff line change @@ -72,5 +72,45 @@ define([
72
72
} ) ;
73
73
} ) ;
74
74
75
+ describe ( 'Parent config properties are propagated' , function ( ) {
76
+ it ( 'sets the disabled property on the child element' , function ( ) {
77
+ var params = {
78
+ dataScope : 'urlInput' ,
79
+ disabled : true ,
80
+ urlTypes : {
81
+ url : {
82
+ label : 'Test label' ,
83
+ component : 'Magento_Ui/js/form/element/abstract' ,
84
+ template : 'ui/form/element/input' ,
85
+ sortOrder : 40
86
+ }
87
+ }
88
+ } ;
89
+
90
+ component = new UrlInput ( params ) ;
91
+ expect ( component . disabled ( ) ) . toBe ( true ) ;
92
+ expect ( component . urlTypes . url . disabled ) . toBe ( true ) ;
93
+ } ) ;
94
+
95
+ it ( 'sets the visible property on the child element' , function ( ) {
96
+ var params = {
97
+ dataScope : 'urlInput' ,
98
+ visible : false ,
99
+ urlTypes : {
100
+ url : {
101
+ label : 'Test label' ,
102
+ component : 'Magento_Ui/js/form/element/abstract' ,
103
+ template : 'ui/form/element/input' ,
104
+ sortOrder : 40
105
+ }
106
+ }
107
+ } ;
108
+
109
+ component = new UrlInput ( params ) ;
110
+ expect ( component . visible ( ) ) . toBe ( false ) ;
111
+ expect ( component . urlTypes . url . visible ) . toBe ( false ) ;
112
+ } ) ;
113
+ } ) ;
114
+
75
115
} ) ;
76
116
} ) ;
You can’t perform that action at this time.
0 commit comments