diff --git a/src/web/issue.rs b/src/web/issue.rs index 8982505..15123b7 100644 --- a/src/web/issue.rs +++ b/src/web/issue.rs @@ -1941,6 +1941,17 @@ mod tests { ); let content_html = item["content_html"].as_str().unwrap(); assert!(content_html.contains("

"), "{content_html}"); + assert!( + content_html.contains("

A. Writer · Example Feed · example.com

"), + "{content_html}" + ); + assert!( + content_html.contains( + "

Hacker News

" + ), + "{content_html}" + ); + assert!(!content_html.contains(" — "), "{content_html}"); assert!( !item["date_published"].as_str().unwrap().is_empty(), "{item}" diff --git a/src/web/public.rs b/src/web/public.rs index 8277b64..81967aa 100644 --- a/src/web/public.rs +++ b/src/web/public.rs @@ -553,4 +553,35 @@ mod tests { assert!(!html.contains(private), "leaked {private:?} in {html}"); } } + + #[test] + fn feed_entry_wraps_byline_and_links_in_paragraphs() { + let mut source = crate::epub::fixtures::issue(); + // A second comment link, so the separator between links is exercised. + source.lineup.picks[0].article.comments_url = + Some("https://example.com/discuss".to_string()); + let issue = PublicIssue::from(&source); + let html = FeedEntryTemplate { issue: &issue }.render().unwrap(); + + assert!(html.contains("

Top Stories