minor cleanup
This commit is contained in:
parent
24f6052ed0
commit
2a78c4429b
1 changed files with 18 additions and 19 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Reference in a new issue