1
Fork 0
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:
archivr-qa 2026-08-23 20:51:19 +02:00
parent b17db8d04a
commit 55a74ea3c2
No known key found for this signature in database
3 changed files with 19 additions and 1 deletions

View file

@ -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!({