Lines
100 %
Functions
Branches
use super::*;
use crate::form_render::fixture::assert_fixture;
use crate::form_render::{References, render_form_reloading};
use forms::FormValues;
#[test]
fn the_updated_message_names_the_id() {
let id = Uuid::from_u128(7);
assert_eq!(updated_message(id), format!("Script updated: {id}"));
}
fn the_script_id_must_be_a_uuid() {
assert_eq!(parse_script_id(&id.to_string()).ok(), Some(id));
assert!(parse_script_id("nope").is_err());
fn the_browser_fixture_of_the_script_edit_form_is_up_to_date() {
let mut values = FormValues::default();
values.set("id", &id.to_string());
values.set("revision", "r1");
values.set("name", "tag-sync");
values.set("source", "(+ 1 2)");
values.set("enabled", "true");
let reload = EDIT.page.replace("{id}", &id.to_string());
let html = render_form_reloading(
&SCRIPT_EDIT,
&values,
&[],
SUBMIT_PATH,
&References::default(),
&reload,
)
.expect("renders");
assert_fixture("script_edit.html", &html);