Use local feedserver to test the logo/favicon logic

Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
This commit is contained in:
Benjamin Brahmer 2024-03-31 14:51:59 +02:00
parent abb9c57f03
commit f5dc9a6aca
5 changed files with 8 additions and 7 deletions

View File

@ -39,16 +39,17 @@ teardown() {
assert_output --partial "Something-${BATS_SUITE_TEST_NUMBER}"
}
# Test if Feed-Logo is used if available (NC_FEED) and if favicon is used if no logo is provided (HEISE_FEED)
@test "[$TESTSUITE] Favicon" {
./occ news:feed:add "$user" "https://nextcloud.com/blog/static-feed/" --title "Something-${BATS_SUITE_TEST_NUMBER}"
./occ news:feed:add "$user" "https://www.heise.de/rss/heise-atom.xml" --title "Something-${BATS_SUITE_TEST_NUMBER}"
./occ news:feed:add "$user" "$NC_FEED" --title "Something-${BATS_SUITE_TEST_NUMBER}"
./occ news:feed:add "$user" "$HEISE_FEED" --title "Something-${BATS_SUITE_TEST_NUMBER}"
run ./occ news:feed:list "$user"
assert_success
assert_output --partial '"faviconLink": "https:\/\/nextcloud.com\/c\/uploads\/2022\/03\/favicon.png",'
assert_output --partial '"faviconLink": "https:\/\/www.heise.de\/favicon.ico?v='
assert_output --partial '"faviconLink": "http:\/\/localhost:8090\/logo.png",'
assert_output --partial '"faviconLink": "http:\/\/localhost:8090\/favicon.ico'
}
@test "[$TESTSUITE] List all items" {

View File

@ -21,9 +21,9 @@
<generator>https://wordpress.org/?v=6.0.1</generator>
<image>
<url>https://nextcloud.com/wp-content/uploads/2022/03/favicon.png</url>
<url>http://localhost:8090/logo.png</url>
<title>Nextcloud</title>
<link>https://nextcloud.com/</link>
<link>http://localhost:8090</link>
<width>32</width>
<height>32</height>
</image>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -8,7 +8,7 @@
</author>
<link rel="self" type="application/atom+xml" href="http://localhost:8090/heise.xml"/>
<link rel="alternate" type="text/html" href="https://www.heise.de/"/>
<link rel="alternate" type="text/html" href="http://localhost:8090"/>
<rights>Copyright (c) 2022 Heise Medien</rights>
<entry>

Binary file not shown.

After

Width:  |  Height:  |  Size: 678 B