22
33from reactpy import Ref , component , html , use_location
44from reactpy .testing import DisplayFixture
5- from reactpy_router import link , route , routers , use_params , use_search_params
5+ from reactpy_router import browser_router , link , route , use_params , use_search_params
66
77
88async def test_simple_router (display : DisplayFixture ):
@@ -18,7 +18,7 @@ def check_location():
1818
1919 @component
2020 def sample ():
21- return routers . browser_router (
21+ return browser_router (
2222 make_location_check ("/a" ),
2323 make_location_check ("/b" ),
2424 make_location_check ("/c" ),
@@ -40,8 +40,8 @@ def sample():
4040 root_element = await display .root_element ()
4141 except AttributeError :
4242 root_element = await display .page .wait_for_selector (
43- f"#display-{ display ._next_view_id } " ,
44- state = "attached" , # type: ignore
43+ f"#display-{ display ._next_view_id } " , # type: ignore
44+ state = "attached" ,
4545 )
4646
4747 assert not await root_element .inner_html ()
@@ -50,7 +50,7 @@ def sample():
5050async def test_nested_routes (display : DisplayFixture ):
5151 @component
5252 def sample ():
53- return routers . browser_router (
53+ return browser_router (
5454 route (
5555 "/a" ,
5656 html .h1 ({"id" : "a" }, "A" ),
@@ -79,7 +79,7 @@ async def test_navigate_with_link(display: DisplayFixture):
7979 @component
8080 def sample ():
8181 render_count .current += 1
82- return routers . browser_router (
82+ return browser_router (
8383 route ("/" , link ("Root" , to = "/a" , id = "root" )),
8484 route ("/a" , link ("A" , to = "/b" , id = "a" )),
8585 route ("/b" , link ("B" , to = "/c" , id = "b" )),
@@ -110,7 +110,7 @@ def check_params():
110110
111111 @component
112112 def sample ():
113- return routers . browser_router (
113+ return browser_router (
114114 route (
115115 "/first/{first:str}" ,
116116 check_params (),
@@ -146,7 +146,7 @@ def check_query():
146146
147147 @component
148148 def sample ():
149- return routers . browser_router (route ("/" , check_query ()))
149+ return browser_router (route ("/" , check_query ()))
150150
151151 await display .show (sample )
152152
@@ -158,7 +158,7 @@ def sample():
158158async def test_browser_popstate (display : DisplayFixture ):
159159 @component
160160 def sample ():
161- return routers . browser_router (
161+ return browser_router (
162162 route ("/" , link ("Root" , to = "/a" , id = "root" )),
163163 route ("/a" , link ("A" , to = "/b" , id = "a" )),
164164 route ("/b" , link ("B" , to = "/c" , id = "b" )),
@@ -190,7 +190,7 @@ def sample():
190190async def test_relative_links (display : DisplayFixture ):
191191 @component
192192 def sample ():
193- return routers . browser_router (
193+ return browser_router (
194194 route ("/" , link ("Root" , to = "/a" , id = "root" )),
195195 route ("/a" , link ("A" , to = "/a/b" , id = "a" )),
196196 route ("/a/b" , link ("B" , to = "../a/b/c" , id = "b" )),
0 commit comments