Skip to content
This repository was archived by the owner on Jan 26, 2022. It is now read-only.

Commit 2a2ec39

Browse files
committed
Update page and test
1 parent 0680cd9 commit 2a2ec39

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

src/App.test.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,23 @@ let app: any;
1111
let wrapper: any;
1212

1313
beforeAll(() => {
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

2525
afterAll(() => {
26-
wrapper.unmount();
26+
wrapper.unmount();
2727
});
2828

2929
describe('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
});

src/Page.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ import Login from './pages/Login/Login';
1212

1313
// Global pages router
1414
const 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

2929
export default Env === EnvType.Development ? hot(module)(Page) : Page;

0 commit comments

Comments
 (0)