Diff options
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0005-markup.sh | 23 |
1 file changed, 23 insertions, 0 deletions
diff --git a/tests/t0005-markup.sh b/tests/t0005-markup.sh index f5034f0..d5b1610 100755 --- a/tests/t0005-markup.sh +++ b/tests/t0005-markup.sh @@ -228,6 +228,29 @@ test_expect_success 'the pages ask robots what the robots setting says' ' test_grep ! "<meta name=.robots." tmp ' +# The index has no repository to describe, so the head and the header carry +# the site's description. A head-include lands in the head and a header file +# ahead of div#cgit. +test_expect_success 'root-desc, favicon, head-include and header reach the index' ' + echo "<meta name=site-head content=included>" >head.html && + echo "<div class=site-header>site header</div>" >header.html && + { + echo "root-desc=Hooks for themes" && + echo "favicon=/icon.png" && + echo "head-include=$PWD/head.html" && + echo "header=$PWD/header.html" && + cat hooksrc + } >headrc && + cgit_ok headrc "url=" >tmp && + sed -n "/^<head>\$/,/^<\/head>\$/p" tmp >head && + test_grep "<meta name=.description. content=.Hooks for themes.>" head && + test_grep "<link rel=.icon. href=./icon.png.>" head && + test_grep "<meta name=site-head content=included>" head && + test_grep "<p class=.sub desc.>Hooks for themes</p>" tmp && + sed -n "/^<body>\$/,/^<div id=.cgit./p" tmp | sed -e 1d -e \$d >actual && + test_cmp header.html actual +' + # A browser gives these elements a monospace font of its own, which would # otherwise win over the one a theme sets through --font-mono. test_expect_success 'every monospace element takes the theme font' ' |
