summaryrefslogtreecommitdiff
path: root/test/js/index.html
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2011-04-17 11:24:28 -0400
committerNed Batchelder <ned@nedbatchelder.com>2011-04-17 11:24:28 -0400
commit3aebea207bace4845b06ee9d5491487618352239 (patch)
tree17b72e2bcb8b94dd89ea67eae4715ac170c86311 /test/js/index.html
parente978f71338cad069e5fe125de462c5a11a445f96 (diff)
downloadpython-coveragepy-git-3aebea207bace4845b06ee9d5491487618352239.tar.gz
Even better way to test js: build fixtures programmatically, no need for monkeypatching the code under test.
Diffstat (limited to 'test/js/index.html')
-rw-r--r--test/js/index.html68
1 files changed, 29 insertions, 39 deletions
diff --git a/test/js/index.html b/test/js/index.html
index f89c57af..746dc374 100644
--- a/test/js/index.html
+++ b/test/js/index.html
@@ -4,15 +4,40 @@
<title>Coverage.py Javascript Test Suite</title>
<link rel="stylesheet" href="../qunit/qunit.css" type="text/css" media="screen">
<script type="text/javascript" src="../../coverage/htmlfiles/jquery-1.4.3.min.js"></script>
+ <script type='text/javascript' src="../../coverage/htmlfiles/jquery.isonscreen.js"></script>
<script type="text/javascript" src="../../coverage/htmlfiles/coverage_html.js"></script>
<script type="text/javascript" src="../qunit/qunit.js"></script>
+ <script type="text/javascript" src="../qunit/jquery.tmpl.min.js"></script>
<style>
- .red { background-color: red; }
- .white { }
- .blue { background-color: blue; }
+ .r { background-color: red; }
+ .w { }
+ .b { background-color: blue; }
</style>
+ <!-- Templates for the coverage report output -->
+ <script id="fixture-template" type="text/x-jquery-tmpl">
+ <table cellspacing='0' cellpadding='0'>
+ <tr>
+ <td class='linenos' valign='top'>
+ <!-- #lineno-template goes here -->
+ </td>
+ <td class='text' valign='top'>
+ <!-- #text-template goes here -->
+ </td>
+ </tr>
+ </table>
+ </script>
+
+ <script id="lineno-template" type="text/x-jquery-tmpl">
+ <p id='n${number}' class='${klass}'><a href='#n${number}'>${number}</a></p>
+ </script>
+
+ <script id="text-template" type="text/x-jquery-tmpl">
+ <p id='t${number}' class='${klass}'>Hello, world!</p>
+ </script>
+
+ <!-- Pull in the tests -->
<script type="text/javascript" src="tests.js"></script>
</head>
@@ -22,41 +47,6 @@
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
- <div id="qunit-fixture">
-
- <div id='rrwwrr'>
- <p class='t1 red'>red</p>
- <p class='t2 red'>red</p>
- <p class='t3 white'>white</p>
- <p class='t4 white'>white</p>
- <p class='t5 red'>red</p>
- <p class='t6 red'>red</p>
- </div>
-
- <div id='rb'>
- <p class='t1 red'>red</p>
- <p class='t2 blue'>blue</p>
- </div>
-
- <div id='wrrwrrw'>
- <p class='t1 white'>white</p>
- <p class='t2 red'>red</p>
- <p class='t3 red'>red</p>
- <p class='t4 white'>white</p>
- <p class='t5 red'>red</p>
- <p class='t6 red'>red</p>
- <p class='t7 white'>white</p>
- </div>
-
- <div id='rrrbbb'>
- <p class='t1 red'>red</p>
- <p class='t2 red'>red</p>
- <p class='t3 red'>red</p>
- <p class='t4 blue'>blue</p>
- <p class='t5 blue'>blue</p>
- <p class='t6 blue'>blue</p>
- </div>
-
- </div>
+ <div id="qunit-fixture"></div>
</body>
</html>