diff --git a/src/outbound/services/site.rs b/src/outbound/services/site.rs index f342096..1a33178 100644 --- a/src/outbound/services/site.rs +++ b/src/outbound/services/site.rs @@ -136,19 +136,16 @@ mod tests { assert_eq!(page.info.title, "Home"); assert_eq!(page.info.name, "/"); - // page content must be a single text block - let PageContent::Single { - content: page_content, - } = page.content - else { - panic!("page content must be a single text block"); - }; - assert_eq!(page_content.blocks.len(), 1); - - let Block::Text { text } = &page_content.blocks[0] else { - panic!("page content must be a single text block"); - }; - assert_eq!(text, "Hello, world!"); + assert_eq!( + page.content, + PageContent::Single { + content: Post { + blocks: vec![Block::Text { + text: "Hello, world!".to_string(), + }], + } + } + ); } #[tokio::test] @@ -166,12 +163,14 @@ mod tests { .get_post("example.com", "home_posts", "post_id") .await .unwrap(); - assert_eq!(post.blocks.len(), 1); - - let Block::Text { text } = &post.blocks[0] else { - panic!("page content must be a single text block"); - }; - assert_eq!(text, "Hello, world!"); + assert_eq!( + post, + Post { + blocks: vec![Block::Text { + text: "Hello, world!".to_string(), + },] + } + ); } #[tokio::test]