Add another integrated render snapshot test
This commit is contained in:
parent
91ba94a38a
commit
b119bf376c
@ -1,5 +1,5 @@
|
||||
use bevy_reflect::Reflect;
|
||||
use hornbeam_interpreter::{localisation::NoLocalisation, LoadedTemplates, Params};
|
||||
use hornbeam_interpreter::{localisation::DebugLocalisationSystem, LoadedTemplates, Params};
|
||||
use insta::assert_snapshot;
|
||||
|
||||
#[derive(Reflect)]
|
||||
@ -20,7 +20,7 @@ fn simple_test_struct() -> SimpleTestStruct {
|
||||
}
|
||||
|
||||
fn simple_render(template: &str) -> String {
|
||||
let mut templates = LoadedTemplates::new(NoLocalisation);
|
||||
let mut templates = LoadedTemplates::new(DebugLocalisationSystem);
|
||||
templates
|
||||
.load_template_from_str("main", template, "main.hnb")
|
||||
.expect("failed to load template");
|
||||
@ -54,3 +54,14 @@ html
|
||||
"#
|
||||
))
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn snapshot_002() {
|
||||
assert_snapshot!(simple_render(
|
||||
r#"
|
||||
@localiseMe{x=5}
|
||||
br
|
||||
"$five"
|
||||
"#
|
||||
))
|
||||
}
|
||||
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
source: hornbeam_interpreter/tests/snapshots.rs
|
||||
expression: "simple_render(r#\"\n@localiseMe{x=5}\nbr\n\"$five\"\n \"#)"
|
||||
---
|
||||
@localiseMe{{"x": Int(5)}}<br>5
|
Loading…
Reference in New Issue
Block a user