mirror of
https://github.com/thegeneralist01/archivr
synced 2026-10-09 21:03:17 +02:00
fix: preserve X Article block order
This commit is contained in:
parent
b17db8d04a
commit
55a74ea3c2
3 changed files with 19 additions and 1 deletions
|
|
@ -1274,6 +1274,23 @@ mod tests {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn extract_tweet_text_keeps_article_block_object_field_order() {
|
||||
let tweet: serde_json::Value = serde_json::from_str(
|
||||
r#"{
|
||||
"article": {
|
||||
"title": "Ordered block",
|
||||
"blocks": [{"heading": "Opening", "content": "Body copy"}]
|
||||
}
|
||||
}"#,
|
||||
)
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
extract_tweet_text(&tweet).as_deref(),
|
||||
Some("Ordered block\n\nOpening\n\nBody copy")
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn extract_tweet_text_falls_back_from_article_preview_to_summary_then_tweet_body() {
|
||||
let preview = serde_json::json!({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue