diff options
| author | Paul Buetow <paul@buetow.org> | 2026-06-11 10:49:42 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-06-11 10:49:42 +0300 |
| commit | 4ec261d55e9d5b1f88f3a0a37a55d1cd699d193b (patch) | |
| tree | 3768b47e11d0c54113d2871abaa16220e2edffc0 /tests/cli.sh | |
| parent | 1e7b394e56085a9cc33b8b8b64b094d5223e8853 (diff) | |
Copy favicon when refreshing splash
Diffstat (limited to 'tests/cli.sh')
| -rwxr-xr-x | tests/cli.sh | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/cli.sh b/tests/cli.sh index 2a71dba..7870a86 100755 --- a/tests/cli.sh +++ b/tests/cli.sh @@ -2456,6 +2456,37 @@ test_refresh_splash_rewrites_only_index_from_existing_assets() { test::teardown } +test_refresh_splash_copies_favicon_for_legacy_dist() { + local config_file + local output + local top_index_html + + test::setup + config_file="$TEST_TMPDIR/photoalbum.conf" + mkdir -p \ + "$TEST_TMPDIR/incoming" \ + "$TEST_TMPDIR/dist/photos" \ + "$TEST_TMPDIR/dist/blurs" + printf 'legacy photo\n' > "$TEST_TMPDIR/dist/photos/legacy.jpg" + printf 'legacy blur\n' > "$TEST_TMPDIR/dist/blurs/legacy.jpg" + test::write_album_config \ + "$config_file" "$TEST_TMPDIR/incoming" "$TEST_TMPDIR/dist" \ + 'Legacy refresh album' 40 + + output=$( + cd "$TEST_TMPDIR" + "$TEST_PHOTOALBUM" --refresh-splash + ) + + top_index_html=$(<"$TEST_TMPDIR/dist/index.html") + test::assert_contains 'Refreshed splash page' "$output" + test::assert_contains \ + '<link rel="icon" href="./favicon.ico" type="image/x-icon">' \ + "$top_index_html" + test::assert_file_exists "$TEST_TMPDIR/dist/favicon.ico" + test::teardown +} + test_refresh_splash_requires_existing_generated_assets() { local config_file local output @@ -3774,6 +3805,9 @@ main() { '--refresh-splash rewrites only root index from existing assets' \ test_refresh_splash_rewrites_only_index_from_existing_assets test::run_case \ + '--refresh-splash copies favicon for legacy dist' \ + test_refresh_splash_copies_favicon_for_legacy_dist + test::run_case \ '--refresh-splash requires existing generated assets' \ test_refresh_splash_requires_existing_generated_assets test::run_case \ |
