test(examples): assert escaped text exactly

Make v0 and kanban DOM-aware escaped-text checks exact instead of substring-based while preserving the no-rendered-tag assertions.

req: html_safety/002

req: test/005
This commit is contained in:
slhx agent
2026-05-25 23:23:14 +02:00
parent 9b06bc03df
commit 4d4f5cd2bc
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -355,7 +355,8 @@ mod tests {
.select(&selector("article.card[data-key=\"1\"]"))
.next()
.expect("card renders");
assert!(card.text().collect::<String>().contains("<b>Compile checked</b>"));
let title = card.select(&selector("strong")).next().expect("card title renders");
assert_eq!(title.text().collect::<String>(), "<b>Compile checked</b>");
assert!(card.select(&selector("b")).next().is_none());
assert_eq!(card.select(&selector("button[disabled]")).count(), 1);
}
+1 -1
View File
@@ -301,7 +301,7 @@ mod tests {
let rows = document.select(&selector("li[data-key]")).collect::<Vec<_>>();
assert_eq!(rows.len(), 1);
assert_eq!(rows[0].value().attr("data-key"), Some("7"));
assert!(rows[0].text().collect::<String>().contains("<b>Ship v0</b>"));
assert_eq!(rows[0].text().collect::<String>(), "<b>Ship v0</b>");
assert!(document.select(&selector("b")).next().is_none());
}