@@ -103,6 +103,42 @@ describe("pat-dependshandler", function () {
103
103
} ) ;
104
104
105
105
describe ( "_getValue" , function ( ) {
106
+ it ( "Just get the text value." , function ( ) {
107
+ document . body . innerHTML = `
108
+ <div id="lab">
109
+ <input name="foo" value="bar"/>
110
+ </div>
111
+ ` ;
112
+ const lab = document . getElementById ( "lab" ) ;
113
+ const handler = new DependsHandler ( lab , "foo" ) ;
114
+
115
+ expect ( handler . _getValue ( "foo" ) ) . toBe ( "bar" ) ;
116
+ } ) ;
117
+
118
+ it ( "Get an empty value from an empty input." , function ( ) {
119
+ document . body . innerHTML = `
120
+ <div id="lab">
121
+ <input name="foo" value=""/>
122
+ </div>
123
+ ` ;
124
+ const lab = document . getElementById ( "lab" ) ;
125
+ const handler = new DependsHandler ( lab , "foo" ) ;
126
+
127
+ expect ( handler . _getValue ( "foo" ) ) . toBe ( "" ) ;
128
+ } ) ;
129
+
130
+ it ( "Get null from a disabled input." , function ( ) {
131
+ document . body . innerHTML = `
132
+ <div id="lab">
133
+ <input name="foo" value="bar" disabled/>
134
+ </div>
135
+ ` ;
136
+ const lab = document . getElementById ( "lab" ) ;
137
+ const handler = new DependsHandler ( lab , "foo" ) ;
138
+
139
+ expect ( handler . _getValue ( "foo" ) ) . toBe ( null ) ;
140
+ } ) ;
141
+
106
142
it ( "Unchecked checkbox returns no value" , function ( ) {
107
143
document . body . innerHTML = `
108
144
<div id="lab">
0 commit comments