Lines
100 %
Functions
Branches
use super::*;
use crate::form_render::fixture::assert_fixture;
use crate::form_render::{References, render_form};
use forms::FormValues;
#[test]
fn the_created_message_carries_the_notice() {
let id = Uuid::from_u128(7);
assert_eq!(created_message(id, None), format!("New account id: {id}"));
assert_eq!(
created_message(id, Some("twin")),
format!("New account id: {id}. twin")
);
}
fn the_browser_fixture_of_the_account_create_form_is_up_to_date() {
let html = render_form(
&ACCOUNT_CREATE,
&FormValues::default(),
&[],
SUBMIT_PATH,
&References::default(),
)
.expect("renders");
assert_fixture("account_create.html", &html);
fn the_duplicate_notice_is_escaped_in_the_reply() {
let message = created_message(Uuid::from_u128(7), Some("<img src=x onerror=1>"));
let html = crate::pages::forms::message::escaped(&message).expect("renders");
assert!(html.contains("<img"), "{html}");
assert!(!html.contains("<img"), "{html}");