diff options
author | Benjamin Brahmer <info@b-brahmer.de> | 2021-04-28 20:52:50 +0200 |
---|---|---|
committer | Benjamin Brahmer <info@b-brahmer.de> | 2021-05-03 09:28:00 +0200 |
commit | 6dfc4ad844d57ba4289df175d325f058c12025ef (patch) | |
tree | 8ff2fb47dc9cfa32488f0e2e833f8ecf65417630 /tests | |
parent | ccc7153a7282e1820101f9b8e12602a8f3da2557 (diff) |
Prevent some of the favicon fetching errors
change user agent for fetching the feeds log to 'NextCloud-News/1.0'
check if logo in feed is just an empty string
remove path of url before searching for a favicon
check if file was actually downloaded
Ignore http errors when fetching favicons
Add feed to integration tests that doesn't have a logo
Co-authored-by: Alec Kojaev <alec.kojaev@gmail.com>
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration/feeds.bats | 17 | ||||
-rw-r--r-- | tests/integration/helpers/settings.bash | 3 |
2 files changed, 18 insertions, 2 deletions
diff --git a/tests/integration/feeds.bats b/tests/integration/feeds.bats index 2701cbfa9..1e60b5552 100644 --- a/tests/integration/feeds.bats +++ b/tests/integration/feeds.bats @@ -34,9 +34,24 @@ teardown() { return $ret_status fi +} + +@test "[$TESTSUITE] Favicon" { + ./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" + [ "$status" -eq 0 ] + if ! echo "$output" | grep -F '"faviconLink": "https:\/\/nextcloud.com\/media\/screenshot-150x150.png"'; then ret_status=$? - echo "Favicon not found in list" + echo "Logo test failed" + return $ret_status + fi + + if ! echo "$output" | grep -F '"faviconLink": "https:\/\/www.heise.de\/favicon.ico"'; then + ret_status=$? + echo "Favicon test failed" return $ret_status fi } diff --git a/tests/integration/helpers/settings.bash b/tests/integration/helpers/settings.bash index 48b5a3726..4e758b609 100644 --- a/tests/integration/helpers/settings.bash +++ b/tests/integration/helpers/settings.bash @@ -1,2 +1,3 @@ user=admin -NC_FEED="https://nextcloud.com/blog/static-feed/"
\ No newline at end of file +NC_FEED="https://nextcloud.com/blog/static-feed/" +HEISE_FEED="https://www.heise.de/rss/heise-atom.xml"
\ No newline at end of file |