From 29d1b1795ac8e88d3a5b42ac8ee8f23327a12b73 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 18:21:04 -1000 Subject: Test the settings that change the logo --- tests/t0005-markup.sh | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/t0005-markup.sh b/tests/t0005-markup.sh index c05f404..e1da677 100755 --- a/tests/t0005-markup.sh +++ b/tests/t0005-markup.sh @@ -136,11 +136,39 @@ test_expect_success 'a pinned page names its commit before the repository' ' grep "hooks @ $old - $site" tmp ' -# The logo is all its link holds, so it is named for where the link leads, -# which by default is the site's index. -test_expect_success 'the logo is named after the site' ' - cgit_rc hooksrc "url=hooks/" >tmp && - grep ".$site." tmp +# The logo is all its link holds, so it is named after the site, both on the +# default link to the index and on a link logo-link sends elsewhere. +test_expect_success 'the logo is named after the site wherever it links' ' + cgit_ok hooksrc "url=hooks/" >tmp && + test_grep ".$site." tmp && + { + echo "logo-link=https://example.org/" && + cat hooksrc + } >logorc && + cgit_ok logorc "url=hooks/" >tmp && + test_grep ".$site." tmp +' + +test_expect_success 'a repository logo stands in on its own pages' ' + { + cat hooksrc && + echo "repo.logo=/hooks.png" + } >logorc && + cgit_ok logorc "url=hooks/" >tmp && + test_grep ".$site." tmp && + cgit_ok logorc "url=" >tmp && + test_grep ".$site." tmp +' + +test_expect_success 'an empty logo leaves the header without one' ' + { + echo "logo=" && + cat hooksrc + } >logorc && + cgit_ok logorc "url=hooks/" >tmp && + test_grep "
" tmp && + test_grep ! "class=.logo." tmp && + test_grep ! "