1
1
import { describe , test , expect } from "vitest" ;
2
2
import { createComponentTree } from "./createComponentTree" ;
3
- import { ViewRouter } from "../http/ViewRouter" ;
4
- import { Controller } from "../http/Controller" ;
3
+ import { ViewRouter } from "../../ http/ViewRouter" ;
4
+ import { Controller } from "../../ http/Controller" ;
5
5
6
6
class TestController extends Controller {
7
7
test ( ) {
@@ -19,7 +19,7 @@ class FlatRouter extends ViewRouter {
19
19
20
20
class NestedRouter extends ViewRouter {
21
21
routes = {
22
- "/" : this . view ( "Layout" , [ TestController , "test" ] , {
22
+ "/" : this . layout ( "Layout" , [ TestController , "test" ] , {
23
23
"/" : this . view ( "Home" , [ TestController , "test" ] ) ,
24
24
"/about" : this . view ( "About" , [ TestController , "test" ] ) ,
25
25
"/pricing" : this . view ( "Pricing" , [ TestController , "test" ] ) ,
@@ -29,7 +29,7 @@ class NestedRouter extends ViewRouter {
29
29
30
30
class ProductsRouter extends ViewRouter {
31
31
routes = {
32
- "/" : this . view ( "ProductsLayout" , [ TestController , "test" ] , {
32
+ "/" : this . layout ( "ProductsLayout" , [ TestController , "test" ] , {
33
33
"/" : this . view ( "Products" ) ,
34
34
"/:productId" : this . view ( "Product" ) ,
35
35
"/:productId/providers" : this . view ( "ProductProviders" ) ,
@@ -39,13 +39,13 @@ class ProductsRouter extends ViewRouter {
39
39
40
40
class DeeplyNestedRouter extends ViewRouter {
41
41
routes = {
42
- "/" : this . view ( "Layout" , [ TestController , "test" ] , {
42
+ "/" : this . layout ( "Layout" , [ TestController , "test" ] , {
43
43
"/" : this . view ( "Home" , [ TestController , "test" ] ) ,
44
44
"/about" : this . view ( "About" , [ TestController , "test" ] ) ,
45
45
"/pricing" : this . view ( "Pricing" , [ TestController , "test" ] ) ,
46
46
"/products" : ProductsRouter ,
47
- "/foo" : this . view ( "Foo" , [ TestController , "test" ] , {
48
- "/bar" : this . view ( "Bar" , [ TestController , "test" ] , {
47
+ "/foo" : this . layout ( "Foo" , [ TestController , "test" ] , {
48
+ "/bar" : this . layout ( "Bar" , [ TestController , "test" ] , {
49
49
"/baz" : this . view ( "Baz" , [ TestController , "test" ] ) ,
50
50
"/cux" : this . view ( "Cux" , [ TestController , "test" ] ) ,
51
51
} ) ,
0 commit comments