use pagetop::prelude::*;
async fn render(mut icon: Icon) -> String {
icon.render(&mut Context::default()).await.into_string()
}
#[pagetop::test]
async fn icon_without_source_renders_nothing() {
assert!(render(Icon::new()).await.is_empty());
assert!(
render(Icon::with(icon::Core::Check).with_source(None))
.await
.is_empty()
);
}
#[pagetop::test]
async fn svg_icon_renders_an_inline_svg_scaled_to_the_font() {
let html = render(Icon::with(icon::Core::Check)).await;
assert!(html.starts_with(""));
}
#[pagetop::test]
async fn button_renders_its_end_icon_after_the_label() {
let mut button =
Button::plain(Lc::n("Next")).with_icon_end(Icon::with(icon::Core::ChevronRight));
let html = button.render(&mut Context::default()).await.into_string();
assert!(html.contains("Next