site_map.rs 993 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. use dioxus::prelude::*;
  2. #[test]
  3. fn with_class() {
  4. #[derive(Routable, Clone, PartialEq, Debug)]
  5. enum ChildRoute {
  6. #[route("/")]
  7. ChildRoot {},
  8. #[route("/:not_static")]
  9. NotStatic { not_static: String },
  10. }
  11. #[derive(Routable, Clone, PartialEq, Debug)]
  12. enum Route {
  13. #[route("/")]
  14. Root {},
  15. #[route("/test")]
  16. Test {},
  17. #[child("/child")]
  18. Nested { child: ChildRoute },
  19. }
  20. #[component]
  21. fn Test() -> Element {
  22. todo!()
  23. }
  24. #[component]
  25. fn Root() -> Element {
  26. todo!()
  27. }
  28. #[component]
  29. fn ChildRoot() -> Element {
  30. todo!()
  31. }
  32. #[component]
  33. fn NotStatic(not_static: String) -> Element {
  34. todo!()
  35. }
  36. assert_eq!(
  37. Route::static_routes(),
  38. vec![
  39. Route::Root {},
  40. Route::Test {},
  41. Route::Nested {
  42. child: ChildRoute::ChildRoot {}
  43. },
  44. ],
  45. );
  46. }