瀏覽代碼

fix: wasm test

Jonathan Kelley 3 年之前
父節點
當前提交
cdbc37711f
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      packages/router/tests/web_router.rs

+ 2 - 2
packages/router/tests/web_router.rs

@@ -21,7 +21,7 @@ fn simple_test() {
     static APP: Component = |cx| {
     static APP: Component = |cx| {
         cx.render(rsx! {
         cx.render(rsx! {
             Router {
             Router {
-                onchange: move |route| log::info!("route changed to {}", route),
+                onchange: move |route: RouterService| log::info!("route changed to {:?}", route.current_location()),
                 Route { to: "/", Home {} }
                 Route { to: "/", Home {} }
                 Route { to: "blog"
                 Route { to: "blog"
                     Route { to: "/", BlogList {} }
                     Route { to: "/", BlogList {} }
@@ -48,7 +48,7 @@ fn simple_test() {
     }
     }
 
 
     fn BlogPost(cx: Scope) -> Element {
     fn BlogPost(cx: Scope) -> Element {
-        let id = use_route(&cx).segment::<usize>("id")?;
+        let id = use_route(&cx).parse_segment::<usize>("id")?;
 
 
         cx.render(rsx! {
         cx.render(rsx! {
             div {
             div {