61c6ab3fb0
functional tests, unless a whole lot of mock objects are introduced, which isn't entirely out of the question). Uses JsUnit, which is included in this commit.
43 lines
1.5 KiB
HTML
43 lines
1.5 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
<title>JsUnit Framework tests</title>
|
|
<link rel="stylesheet" type="text/css" href="../css/jsUnitStyle.css">
|
|
<script language="JavaScript" type="text/javascript" src="../app/jsUnitCore.js"></script>
|
|
<script language="JavaScript" type="text/javascript">
|
|
|
|
function testOriginalHTMLPresent1() {
|
|
assertJsUnitjsUnitRestoredHTMLDivContainsOriginalHTML();
|
|
}
|
|
|
|
function testAlterOriginalHTML() {
|
|
var theDiv = document.getElementById("jsUnitRestoredHTML");
|
|
theDiv.innerHTML = "something <i>totally</i> different";
|
|
}
|
|
|
|
function testOriginalHTMLPresent2() {
|
|
assertJsUnitjsUnitRestoredHTMLDivContainsOriginalHTML();
|
|
}
|
|
|
|
function assertJsUnitjsUnitRestoredHTMLDivContainsOriginalHTML() {
|
|
var theDiv = document.getElementById("jsUnitRestoredHTML");
|
|
assertHTMLEquals(
|
|
'<b>foo</b><input type="text" name="bar" value="12345">',
|
|
theDiv.innerHTML);
|
|
}
|
|
|
|
</script>
|
|
</head>
|
|
|
|
<body>
|
|
<h1>JsUnit Framework tests</h1>
|
|
|
|
<p>This page contains tests for the JsUnit setUp and tearDown framework. To see them, take a look at the source.</p>
|
|
|
|
<div id="jsUnitRestoredHTML"><b>foo</b><input type="text" name="bar" value="12345"></div>
|
|
|
|
</body>
|
|
</html>
|