diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2019-07-04 17:15:38 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2019-07-06 10:04:31 -0400 |
commit | cfdcacea473dede9fb779256c812ff6a098a0714 (patch) | |
tree | 89a05ea92b2048a6b0653b8f4aae8fb374e4a4ec /tests/js | |
parent | 25aff80d444a6b1fa87173ffd8026f69be7ae0d0 (diff) | |
download | python-coveragepy-git-cfdcacea473dede9fb779256c812ff6a098a0714.tar.gz |
HTML: Mark things to show instead of to hide.
Also made some other changes along the way:
* Scroll bar markers change as the selected categories change.
* We don't use css class 'stm' for anything, get rid of it.
* Better sass use all around.
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"); |