Total Complexity | 0 |
Complexity/F | 0 |
Lines of Code | 109 |
Function Count | 0 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 1 | Features | 0 |
1 | import { ID_DELIM } from '../../src/constants'; |
||
2 | |||
3 | export const initialRoutes = [ |
||
4 | { |
||
5 | id: 'index', |
||
6 | pattern: '/', |
||
7 | routes: [ |
||
8 | { |
||
9 | id: 'main', |
||
10 | pattern: '/main/', |
||
11 | data: { |
||
12 | pageTitle: 'test' |
||
13 | }, |
||
14 | routes: [ |
||
15 | { |
||
16 | id: 'main+param+query', |
||
17 | pattern: { |
||
18 | path: '/:param', |
||
19 | query: { |
||
20 | test: 'true' |
||
21 | } |
||
22 | } |
||
23 | }, |
||
24 | { |
||
25 | id: 'main+param', |
||
26 | pattern: '/:param', |
||
27 | data: { |
||
28 | token: 'e287f992d8af8fa21c08' |
||
29 | } |
||
30 | } |
||
31 | ] |
||
32 | }, |
||
33 | { |
||
34 | id: 'test', |
||
35 | pattern: '/test/' |
||
36 | }, |
||
37 | { |
||
38 | pattern: '/empty/' |
||
39 | }, |
||
40 | { |
||
41 | id: 'pattern undefined' |
||
42 | }, |
||
43 | { |
||
44 | |||
45 | } |
||
46 | ] |
||
47 | } |
||
48 | ]; |
||
49 | |||
50 | export const expectedRoutes = [ |
||
51 | { |
||
52 | id: 'main+param+query', |
||
53 | idPath: ['index', 'main', 'main+param+query'].join(ID_DELIM), |
||
54 | pattern: { |
||
55 | path: '/main/:param', |
||
56 | query: { |
||
57 | test: 'true' |
||
58 | } |
||
59 | }, |
||
60 | data: { |
||
61 | pageTitle: 'test' |
||
62 | } |
||
63 | }, |
||
64 | { |
||
65 | id: 'main+param', |
||
66 | idPath: ['index', 'main', 'main+param'].join(ID_DELIM), |
||
67 | pattern: { |
||
68 | path: '/main/:param', |
||
69 | }, |
||
70 | data: { |
||
71 | pageTitle: 'test', |
||
72 | token: 'e287f992d8af8fa21c08' |
||
73 | } |
||
74 | }, |
||
75 | { |
||
76 | id: 'main', |
||
77 | idPath: ['index', 'main'].join(ID_DELIM), |
||
78 | pattern: { |
||
79 | path: '/main/' |
||
80 | }, |
||
81 | data: { |
||
82 | pageTitle: 'test' |
||
83 | } |
||
84 | }, |
||
85 | { |
||
86 | id: 'test', |
||
87 | idPath: ['index', 'test'].join(ID_DELIM), |
||
88 | pattern: { |
||
89 | path: '/test/' |
||
90 | }, |
||
91 | data: {} |
||
92 | }, |
||
93 | { |
||
94 | id: '/empty/', |
||
95 | idPath: ['index', '/empty/'].join(ID_DELIM), |
||
96 | pattern: { |
||
97 | path: '/empty/' |
||
98 | }, |
||
99 | data: {} |
||
100 | }, |
||
101 | { |
||
102 | id: 'index', |
||
103 | idPath: 'index', |
||
104 | pattern: { |
||
105 | path: '/' |
||
106 | }, |
||
107 | data: {} |
||
108 | } |
||
109 | ]; |