Diff options
| -rwxr-xr-x | tests/t0005-markup.sh | 10 |
1 file changed, 5 insertions, 5 deletions
diff --git a/tests/t0005-markup.sh b/tests/t0005-markup.sh index c9acc27..6d9c84d 100755 --- a/tests/t0005-markup.sh +++ b/tests/t0005-markup.sh @@ -255,7 +255,7 @@ test_expect_success 'root-desc, favicon, head-include and header reach the index # otherwise win over the one a theme sets through --font-mono. Each rule is # joined onto a line of its own, so a selector is found wherever it stands in # the list. -test_expect_success 'every monospace element takes the theme font' ' +test_expect_success 'the stylesheet gives every monospace element the theme font' ' tr "\n}" " \n" <"$TEST_OUTPUT_DIRECTORY/../assets/cgit.css" >rules && for element in code kbd pre samp do @@ -272,7 +272,7 @@ test_expect_success 'the stylesheet and the script name only the current hooks' # The background is set as --bg, again on html.cgit-standalone for the canvas # around div#cgit, and in the theme-color tags that colour the browser's own # bar. None of the three can read the others, so they are compared here. -test_expect_success 'the page background is the same everywhere it is set' ' +test_expect_success 'the stylesheet and the theme-color tags agree on the background' ' css="$TEST_OUTPUT_DIRECTORY/../assets/cgit.css" && sed -n "s/^ --bg: *light-dark(\(#[0-9a-f]*\), \(#[0-9a-f]*\));\$/\1 \2/p" "$css" >expect && test_line_count = 1 expect && @@ -285,14 +285,14 @@ test_expect_success 'the page background is the same everywhere it is set' ' test_cmp expect actual ' -test_expect_success 'the script waits for the page instead of holding it up' ' +test_expect_success 'the page loads its script with defer' ' cgit_rc hooksrc "url=hooks/" >tmp && grep "<script src=./cgit.js. defer></script>" tmp ' # A collection from getElementsByClassName is live, so an age the loop moves to # another unit drops out of it at once and the age after it is skipped. -test_expect_success 'the script walks the ages from a list that holds still' ' +test_expect_success 'the script does not use getElementsByClassName' ' test_grep "window.cgit.updateAges" "$TEST_OUTPUT_DIRECTORY/../assets/cgit.js" && test_grep ! "getElementsByClassName" "$TEST_OUTPUT_DIRECTORY/../assets/cgit.js" ' @@ -300,7 +300,7 @@ test_expect_success 'the script walks the ages from a list that holds still' ' # The line anchors carry a scroll margin of half the window, which centres a # line scrolled to the top of the view. Asking scrollIntoView to centre it as # well centres the margin too and drops a range three quarters of the way down. -test_expect_success 'a line range scrolls where a single line does' ' +test_expect_success 'the script leaves centring a line to the stylesheet' ' grep "^ scroll-margin-top: calc(50vh - 1em);$" "$TEST_OUTPUT_DIRECTORY/../assets/cgit.css" && grep "first.scrollIntoView();" "$TEST_OUTPUT_DIRECTORY/../assets/cgit.js" ' |
