This repository was archived by the owner on Jan 26, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +25
-25
lines changed Expand file tree Collapse file tree 2 files changed +25
-25
lines changed Original file line number Diff line number Diff line change @@ -11,23 +11,23 @@ let app: any;
1111let wrapper : any ;
1212
1313beforeAll ( ( ) => {
14- app = dva ( ) ;
15- app . model ( Global ) ;
16- app . router ( ( ) => ( { } ) ) ;
17- app . start ( ) ;
18- wrapper = shallow (
19- < StaticRouter context = { { } } >
20- < App store = { app . _store } location = { { pathname : '/app/dashboard' } } />
21- </ StaticRouter >
22- ) ;
14+ app = dva ( ) ;
15+ app . model ( Global ) ;
16+ app . router ( ( ) => ( { } ) ) ;
17+ app . start ( ) ;
18+ wrapper = shallow (
19+ < StaticRouter context = { { } } >
20+ < App store = { app . _store } location = { { pathname : '/app/dashboard' } } />
21+ </ StaticRouter >
22+ ) ;
2323} ) ;
2424
2525afterAll ( ( ) => {
26- wrapper . unmount ( ) ;
26+ wrapper . unmount ( ) ;
2727} ) ;
2828
2929describe ( 'App Test' , ( ) => {
30- it ( 'Capturing Snapshot of APP' , ( ) => {
31- expect ( toJson ( wrapper ) ) . toMatchSnapshot ( ) ;
32- } ) ;
30+ it ( 'Capturing Snapshot of APP' , ( ) => {
31+ expect ( toJson ( wrapper ) ) . toMatchSnapshot ( ) ;
32+ } ) ;
3333} ) ;
Original file line number Diff line number Diff line change @@ -12,18 +12,18 @@ import Login from './pages/Login/Login';
1212
1313// Global pages router
1414const Page = ( { app } : any ) => (
15- < HashRouter >
16- < Switch >
17- < Route exact path = "/" render = { ( ) => < Redirect to = "/app/dashboard" push /> } />
18- < Route exact path = "/app" render = { ( ) => < Redirect to = "/app/dashboard" push /> } />
19- < Route path = "/login" component = { Login } />
20- < Route path = "/app" render = { ( props : any ) => < App app = { app } { ...props } /> } />
21- < Route path = "/exception/403" component = { NoPermission } />
22- < Route path = "/exception/404" component = { NotFound } />
23- < Route path = "/exception/500" component = { ServerError } />
24- < Redirect to = "/exception/404" />
25- </ Switch >
26- </ HashRouter >
15+ < HashRouter >
16+ < Switch >
17+ < Route exact path = "/" render = { ( ) => < Redirect to = "/app/dashboard" push /> } />
18+ < Route exact path = "/app" render = { ( ) => < Redirect to = "/app/dashboard" push /> } />
19+ < Route path = "/login" component = { Login } />
20+ < Route path = "/app" render = { ( props : any ) => < App app = { app } { ...props } /> } />
21+ < Route path = "/exception/403" component = { NoPermission } />
22+ < Route path = "/exception/404" component = { NotFound } />
23+ < Route path = "/exception/500" component = { ServerError } />
24+ < Redirect to = "/exception/404" />
25+ </ Switch >
26+ </ HashRouter >
2727) ;
2828
2929export default Env === EnvType . Development ? hot ( module ) ( Page ) : Page ;
You can’t perform that action at this time.
0 commit comments