File tree Expand file tree Collapse file tree 6 files changed +43
-73
lines changed
front/src/pages/protected Expand file tree Collapse file tree 6 files changed +43
-73
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import React , { PureComponent } from 'react' ;
2+ import { RouteComponentProps } from 'react-router' ;
3+ import FadeInEntrance from '../../components/fadeInEntrance' ;
4+
5+ // #region types
6+ type Props = { } & RouteComponentProps < any , any > ;
7+ // #endregion
8+
9+ function Protected ( { } : Props ) {
10+ return (
11+ < FadeInEntrance >
12+ < h1 > Protected view</ h1 >
13+ < h3 > If you can read, it means you are authenticated</ h3 >
14+ </ FadeInEntrance >
15+ ) ;
16+ }
17+
18+ Protected . displayName = 'Protected' ;
19+
20+ export default Protected ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+ import { shallow } from 'enzyme' ;
3+ import { MemoryRouter } from 'react-router' ;
4+ import Protected from '../Protected' ;
5+
6+ describe ( 'Protected page' , ( ) => {
7+ it ( 'renders as expected' , ( ) => {
8+ const component = shallow (
9+ < div >
10+ < MemoryRouter >
11+ < Protected />
12+ </ MemoryRouter >
13+ </ div > ,
14+ ) ;
15+ expect ( component ) . toMatchSnapshot ( ) ;
16+ } ) ;
17+ } ) ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+
2+ import { compose } from 'redux' ;
3+ import Protected from './Protected' ;
4+
5+
6+ export default compose ( ) ( Protected ) ;
You can’t perform that action at this time.
0 commit comments