✨ (pagetop): Añade Grid y extrae Flex de Container
This commit is contained in:
parent
dfff12881f
commit
307ca6f62c
44 changed files with 2554 additions and 735 deletions
|
|
@ -14,56 +14,6 @@ async fn is_not_rendered_when_empty() {
|
|||
assert!(html.is_empty());
|
||||
}
|
||||
|
||||
#[pagetop::test]
|
||||
async fn nav_root_class_is_unaffected_by_content_flex() {
|
||||
let mut navbar = Navbar::simple()
|
||||
.with_flex(Flex::new().with_justify(flex::ContentJustify::End))
|
||||
.with_item(navbar::Item::nav(one_link_nav()));
|
||||
let html = navbar.render(&mut Context::default()).await.into_string();
|
||||
|
||||
assert!(html.contains(r#"class="navbar""#));
|
||||
}
|
||||
|
||||
// **< Navbar + Flex (content area) >***************************************************************
|
||||
|
||||
#[pagetop::test]
|
||||
async fn without_flex_content_area_has_no_style_attribute() {
|
||||
let mut navbar = Navbar::simple().with_item(navbar::Item::nav(one_link_nav()));
|
||||
let html = navbar.render(&mut Context::default()).await.into_string();
|
||||
|
||||
assert!(html.contains(r#"class="navbar-content""#));
|
||||
assert!(!html.contains("style="));
|
||||
}
|
||||
|
||||
#[pagetop::test]
|
||||
async fn flex_adds_its_styles_to_the_content_area() {
|
||||
let mut cx = Context::default();
|
||||
let mut navbar = Navbar::simple()
|
||||
.with_flex(Flex::new().with_justify(flex::ContentJustify::End))
|
||||
.with_item(navbar::Item::nav(one_link_nav()));
|
||||
let html = navbar.render(&mut cx).await.into_string();
|
||||
let assets = cx.render_assets().into_string();
|
||||
|
||||
assert!(html.contains("navbar-content"));
|
||||
assert!(html.contains("_flex_"));
|
||||
assert!(html.contains("_flex-justify_flex-end_"));
|
||||
assert!(assets.contains("_flex_{display:flex}"));
|
||||
assert!(assets.contains("_flex-justify_flex-end_{justify-content:flex-end}"));
|
||||
}
|
||||
|
||||
#[pagetop::test]
|
||||
async fn flex_gap_adds_a_style_to_the_content_area() {
|
||||
let mut cx = Context::default();
|
||||
let mut navbar = Navbar::simple()
|
||||
.with_flex(Flex::new().with_gap(align::Gap::Both(UnitValue::RelRem(0.5))))
|
||||
.with_item(navbar::Item::nav(one_link_nav()));
|
||||
let html = navbar.render(&mut cx).await.into_string();
|
||||
let assets = cx.render_assets().into_string();
|
||||
|
||||
assert!(html.contains("_flex-gap_0_5rem_"));
|
||||
assert!(assets.contains("_flex-gap_0_5rem_{gap:0.5rem}"));
|
||||
}
|
||||
|
||||
// **< Navbar + FlexItem::push_end >****************************************************************
|
||||
|
||||
#[pagetop::test]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue