// Domain first part
'[' + rfc1034_ldh_str + ']+'
+
- // Second part and following are separated by a dot
- '(?:\\.[' + rfc1034_ldh_str + ']+)+'
+ // Optional second part and following are separated by a dot
+ '(?:\\.[' + rfc1034_ldh_str + ']+)*'
+
// End of string
'$',
mw.test.addTest( 'typeof $.fn.makeCollapsible',
'function (string)' );
+ // Email validation
+ // TODO: import tests from PHPUnit test suite
+ mw.test.addHead( 'Email validation' );
+
+ mw.test.addTest( 'mw.util.validateEmail( "" )',
+ 'null (object)' );
+
+ mw.test.addTest( 'mw.util.validateEmail( "user@localhost" )',
+ 'true (boolean)' );
+
// Run tests and compare results
var exec,
result,
mediaWiki.test.init();
-} )(jQuery, mediaWiki);
\ No newline at end of file
+} )(jQuery, mediaWiki);