Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use local feedserver to test the logo/favicon logic #2631

Merged
merged 1 commit into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions tests/command/feeds.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
4 changes: 2 additions & 2 deletions tests/test_helper/feeds/Nextcloud.rss
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Binary file added tests/test_helper/feeds/favicon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/test_helper/feeds/heise.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Binary file added tests/test_helper/feeds/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading