Lines
100 %
Functions
Branches
use super::*;
#[test]
fn markup_in_a_message_is_escaped() {
let html = escaped("<img src=x onerror=1>").expect("renders");
assert!(!html.contains("<img"), "{html}");
assert!(html.contains("<img"), "{html}");
}
fn a_plain_message_is_unchanged() {
assert_eq!(
escaped("Config saved: theme").expect("renders"),
"Config saved: theme"
);
#[tokio::test]
async fn a_reply_is_the_escaped_message() {
let response = reply("<b>").expect("renders");
assert_eq!(response.status(), axum::http::StatusCode::OK);
let body = axum::body::to_bytes(response.into_body(), 1024)
.await
.expect("body");
assert_eq!(&body[..], b"<b>");