File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
dev/tests/js/jasmine/tests/lib/mage Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -132,4 +132,35 @@ define([
132
132
) . toEqual ( false ) ;
133
133
} ) ;
134
134
} ) ;
135
+
136
+ describe ( 'Testing UK Mobile number validation' , function ( ) {
137
+ it ( 'Valid UK Mobile Number' , function ( ) {
138
+ var element = $ ( '<input id="telephone" type="text" value="07400123456" />' ) ;
139
+
140
+ expect ( $ . validator . methods . mobileUK . call (
141
+ $ . validator . prototype , element . val ( ) , element . get ( 0 )
142
+ ) ) . toBeTruthy ( ) ;
143
+ } ) ;
144
+ it ( 'Invalid UK Mobile Number' , function ( ) {
145
+ var element = $ ( '<input id="telephone" type="text" value="06400123456" />' ) ;
146
+
147
+ expect ( $ . validator . methods . mobileUK . call (
148
+ $ . validator . prototype , element . val ( ) , element . get ( 0 )
149
+ ) ) . toBeFalsy ( ) ;
150
+ } ) ;
151
+ it ( 'Valid UK Mobile Number (International)' , function ( ) {
152
+ var element = $ ( '<input id="telephone" type="text" value="+447400123456" />' ) ;
153
+
154
+ expect ( $ . validator . methods . mobileUK . call (
155
+ $ . validator . prototype , element . val ( ) , element . get ( 0 )
156
+ ) ) . toBeTruthy ( ) ;
157
+ } ) ;
158
+ it ( 'Invalid UK Mobile Number' , function ( ) {
159
+ var element = $ ( '<input id="telephone" type="text" value="+446400123456" />' ) ;
160
+
161
+ expect ( $ . validator . methods . mobileUK . call (
162
+ $ . validator . prototype , element . val ( ) , element . get ( 0 )
163
+ ) ) . toBeFalsy ( ) ;
164
+ } ) ;
165
+ } ) ;
135
166
} ) ;
You can’t perform that action at this time.
0 commit comments