diff options
Diffstat (limited to 'tests/js')
-rw-r--r-- | tests/js/index.html | 12 | ||||
-rw-r--r-- | tests/js/tests.js | 4 |
2 files changed, 6 insertions, 10 deletions
diff --git a/tests/js/index.html b/tests/js/index.html index 744014bc..d9eb5c03 100644 --- a/tests/js/index.html +++ b/tests/js/index.html @@ -4,18 +4,12 @@ <title>Coverage.py Javascript Test Suite</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> - <link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-2.0.1.css"> + <link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-2.9.2.css"> <script type="text/javascript" src="../../coverage/htmlfiles/jquery.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/jquery.tmpl.min.js"></script> - <style> - .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'> @@ -35,14 +29,14 @@ </script> <script id="text-template" type="text/x-jquery-tmpl"> - <p id='t${number}' class='${klass}'>Hello, world!</p> + <p id='t${number}' class='${klass}{{if klass !== "w"}} show_${klass}{{/if}}'>Hello, world!</p> </script> </head> <body> <div id="qunit"></div> <div id="qunit-fixture"></div> - <script src="https://code.jquery.com/qunit/qunit-2.0.1.js"></script> + <script src="https://code.jquery.com/qunit/qunit-2.9.2.js"></script> <!-- pull in our tests --> <script src="tests.js"></script> </body> diff --git a/tests/js/tests.js b/tests/js/tests.js index 7bd3b9ca..a7eb11fc 100644 --- a/tests/js/tests.js +++ b/tests/js/tests.js @@ -15,10 +15,12 @@ function raw_selection_is(assert, sel, check_highlight) { assert.equal(coverage.sel_begin, beg); assert.equal(coverage.sel_end, end); if (check_highlight) { - assert.equal(coverage.code_container().find(".highlight").length, end-beg); + assert.equal($(".linenos .highlight").length, end-beg); } } +// The spec is a list of "rbw" letters, indicating colors of successive lines. +// We set the show_r and show_b classes for r and b. function build_fixture(spec) { var i, data; $("#fixture-template").tmpl().appendTo("#qunit-fixture"); |