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.title, "Home");
|
||||||
assert_eq!(page.info.name, "/");
|
assert_eq!(page.info.name, "/");
|
||||||
|
|
||||||
// page content must be a single text block
|
assert_eq!(
|
||||||
let PageContent::Single {
|
page.content,
|
||||||
content: page_content,
|
PageContent::Single {
|
||||||
} = page.content
|
content: Post {
|
||||||
else {
|
blocks: vec![Block::Text {
|
||||||
panic!("page content must be a single text block");
|
text: "Hello, world!".to_string(),
|
||||||
};
|
}],
|
||||||
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!");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
@ -166,12 +163,14 @@ mod tests {
|
||||||
.get_post("example.com", "home_posts", "post_id")
|
.get_post("example.com", "home_posts", "post_id")
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
assert_eq!(post.blocks.len(), 1);
|
assert_eq!(
|
||||||
|
post,
|
||||||
let Block::Text { text } = &post.blocks[0] else {
|
Post {
|
||||||
panic!("page content must be a single text block");
|
blocks: vec![Block::Text {
|
||||||
};
|
text: "Hello, world!".to_string(),
|
||||||
assert_eq!(text, "Hello, world!");
|
},]
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
|
Loading…
Add table
Reference in a new issue