dioxus/packages/router/tests/site_map.rs
2024-06-27 16:27:27 -05:00

53 lines
1 KiB
Rust

use dioxus::prelude::*;
#[test]
fn with_class() {
#[derive(Routable, Clone, PartialEq, Debug)]
enum ChildRoute {
#[route("/")]
ChildRoot {},
#[route("/:not_static")]
NotStatic { not_static: String },
}
#[derive(Routable, Clone, PartialEq, Debug)]
enum Route {
#[route("/")]
Root {},
#[route("/test")]
Test {},
#[child("/child")]
Nested { child: ChildRoute },
}
#[component]
fn Test() -> Element {
unimplemented!()
}
#[component]
fn Root() -> Element {
unimplemented!()
}
#[component]
fn ChildRoot() -> Element {
unimplemented!()
}
#[component]
fn NotStatic(not_static: String) -> Element {
unimplemented!()
}
assert_eq!(
Route::static_routes(),
vec![
Route::Root {},
Route::Test {},
Route::Nested {
child: ChildRoute::ChildRoot {}
},
],
);
}