52 lines
1.8 KiB
Rust
52 lines
1.8 KiB
Rust
use std::fs;
|
|
use std::path::PathBuf;
|
|
|
|
#[test]
|
|
fn scene_generator_html_exists_and_has_required_elements() {
|
|
let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
|
|
let html_path = manifest_dir
|
|
.join("frontend")
|
|
.join("scene-generator")
|
|
.join("sg_scene_generator.html");
|
|
|
|
let source = fs::read_to_string(&html_path)
|
|
.unwrap_or_else(|err| panic!("HTML file not found at {:?}: {}", html_path, err));
|
|
|
|
assert!(
|
|
source.contains("Scene Skill Generator") || source.contains("Skill Generator"),
|
|
"missing title"
|
|
);
|
|
assert!(source.contains("sourceDir"), "missing sourceDir input");
|
|
assert!(source.contains("sceneId"), "missing sceneId input");
|
|
assert!(source.contains("sceneName"), "missing sceneName input");
|
|
assert!(
|
|
source.contains("workflowArchetypeOverride"),
|
|
"missing workflow archetype override control"
|
|
);
|
|
assert!(source.contains("previewSceneId"), "missing sceneId preview");
|
|
assert!(
|
|
source.contains("previewSceneIdSource"),
|
|
"missing sceneId source preview"
|
|
);
|
|
assert!(
|
|
source.contains("previewSceneIdValidation"),
|
|
"missing sceneId validation preview"
|
|
);
|
|
assert!(
|
|
!source.contains("settingLessons"),
|
|
"lessons input should be removed from default UI"
|
|
);
|
|
assert!(
|
|
!source.contains("browseLessons"),
|
|
"lessons browse action should be removed from default UI"
|
|
);
|
|
assert!(source.contains("/analyze"), "missing /analyze endpoint");
|
|
assert!(source.contains("/generate"), "missing /generate endpoint");
|
|
assert!(source.contains("fetch("), "missing fetch for API calls");
|
|
assert!(
|
|
source.contains("127.0.0.1") || source.contains("localhost"),
|
|
"should reference localhost server"
|
|
);
|
|
assert!(source.contains("readiness"), "missing readiness UI");
|
|
}
|