// With more than one enabled theme. The single-theme case lives in its own test binary, because the // theme registry is global to the process. use pagetop::prelude::*; struct Aurora; impl Extension for Aurora { fn name(&self) -> Lc { Lc::n("Aurora") } fn theme(&self) -> Option { Some(&Aurora) } } impl Theme for Aurora {} async fn setup() { let _ = Application::prepare(&Aurora).await; } #[pagetop::test] async fn themes_are_sorted_by_name_and_the_selected_one_is_marked() { setup().await; let mut field = form::SelectTheme::new() .with_name("theme") .with_selected("Basic"); let html = field.render(&mut Context::default()).await.into_string(); let aurora = html.find(r#""#)); let mut chosen = form::SelectTheme::new() .with_required(true) .with_selected("Aurora"); let html = chosen.render(&mut Context::default()).await.into_string(); assert!(!html.contains(r#"value="""#)); }