<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" >
<title>Authentification</title>
<script type="text/javascript" src="../../lib/prototype.js"></script>
<script type="text/javascript" src="../../lib/scriptaculous.js"></script>
<script type="text/javascript" src="../../lib/unittest.js"></script>
<script type="text/javascript" src="../../src/util.js"></script>
<script type="text/javascript" src="../../src/formated.js"></script>
<link rel="stylesheet" href="../test.css" type="text/css" />
</head>
<body>
<p>Test util.js</p>
<!-- Log output -->
<div id="testlog"> </div>
<div id="formated">
<form>
<script type="text/javascript">
formated['TEMPORARY_telephones'] = new FormatedTelephone( "TEMPORARY_telephones" );
</script>
<input type="text" value="" size="15" name="TEMPORARY_telephones" id="TEMPORARY_telephones" style="display:none;"
onchange="return combo['telephones'].on_change();" onblur="return
formated['TEMPORARY_telephones'].blur( event );" onkeypress="return
formated['TEMPORARY_telephones'].press( event );" />
<script type="text/javascript">
formated['fax'] = new FormatedTelephone( "fax" );
</script>
<input type="text" value="312-132-1341" size="15" name="fax" id="fax"
onblur="return formated['fax'].blur( event );" onkeypress="return
formated['fax'].press( event );" />
</form>
</div>
<script type="text/javascript">
// --------------------------------------------------------
new Test.Unit.Runner( {
// Loaded
test_loaded: function() {
this.assertNotNull( FormatedField.prototype, "FormatedField class is defined" );
this.assertNotNull( FormatedField.form_validate,
"FormatedField class is defined" );
this.assertNotNull( FormatedNumber.prototype, "FormatedNumber class is defined" );
this.assertNotNull( FormatedDate.prototype, "FormatedDate class is defined" );
this.assertNotNull( FormatedTelephone.prototype, "FormatedTelephone class is defined" );
this.assertNotNull( FormatedHeure.prototype, "FormatedHeure class is defined" );
this.assertNotNull( FormatedArea.prototype, "FormatedArea class is defined" );
},
// ------------
test_form_validate: function() {
var ok = FormatedField.form_validate();
this.assert( ok, "All fields are OK" );
},
// ------------
test_last: function() {
Element.hide( $( "formated" ) );
this.assertNotVisible( $( 'formated' ) );
}
}, "testlog" );
</script>
</body>