@@ -12,7 +12,7 @@ const mockClient = jest.mocked(new Auth0Client({ clientId: '', domain: '' }));
1212describe ( 'withAuthenticationRequired' , ( ) => {
1313 it ( 'should block access to a private component when not authenticated' , async ( ) => {
1414 mockClient . getUser . mockResolvedValue ( undefined ) ;
15- const MyComponent = ( ) : JSX . Element => < > Private</ > ;
15+ const MyComponent = ( ) => < > Private</ > ;
1616 const WrappedComponent = withAuthenticationRequired ( MyComponent ) ;
1717 render (
1818 < Auth0Provider clientId = "__test_client_id__" domain = "__test_domain__" >
@@ -27,7 +27,7 @@ describe('withAuthenticationRequired', () => {
2727
2828 it ( 'should allow access to a private component when authenticated' , async ( ) => {
2929 mockClient . getUser . mockResolvedValue ( { name : '__test_user__' } ) ;
30- const MyComponent = ( ) : JSX . Element => < > Private</ > ;
30+ const MyComponent = ( ) => < > Private</ > ;
3131 const WrappedComponent = withAuthenticationRequired ( MyComponent ) ;
3232 await act ( ( ) => {
3333 render (
@@ -49,8 +49,8 @@ describe('withAuthenticationRequired', () => {
4949 const deferred = defer < User | undefined > ( ) ;
5050 mockClient . getUser . mockResolvedValue ( deferred . promise ) ;
5151
52- const MyComponent = ( ) : JSX . Element => < > Private</ > ;
53- const OnRedirecting = ( ) : JSX . Element => < > Redirecting</ > ;
52+ const MyComponent = ( ) => < > Private</ > ;
53+ const OnRedirecting = ( ) => < > Redirecting</ > ;
5454 const WrappedComponent = withAuthenticationRequired ( MyComponent , {
5555 onRedirecting : OnRedirecting ,
5656 } ) ;
@@ -84,7 +84,7 @@ describe('withAuthenticationRequired', () => {
8484 mockClient . loginWithRedirect . mockImplementationOnce ( async ( ) => {
8585 callOrder . push ( 'loginWithRedirect' ) ;
8686 } ) ;
87- const MyComponent = ( ) : JSX . Element => < > Private</ > ;
87+ const MyComponent = ( ) => < > Private</ > ;
8888 const OnBeforeAuthentication = jest
8989 . fn ( )
9090 . mockImplementationOnce ( async ( ) => {
@@ -112,7 +112,7 @@ describe('withAuthenticationRequired', () => {
112112
113113 it ( 'should pass additional options on to loginWithRedirect' , async ( ) => {
114114 mockClient . getUser . mockResolvedValue ( undefined ) ;
115- const MyComponent = ( ) : JSX . Element => < > Private</ > ;
115+ const MyComponent = ( ) => < > Private</ > ;
116116 const WrappedComponent = withAuthenticationRequired ( MyComponent , {
117117 loginOptions : {
118118 fragment : 'foo' ,
@@ -134,7 +134,7 @@ describe('withAuthenticationRequired', () => {
134134
135135 it ( 'should merge additional appState with the returnTo' , async ( ) => {
136136 mockClient . getUser . mockResolvedValue ( undefined ) ;
137- const MyComponent = ( ) : JSX . Element => < > Private</ > ;
137+ const MyComponent = ( ) => < > Private</ > ;
138138 const WrappedComponent = withAuthenticationRequired ( MyComponent , {
139139 loginOptions : {
140140 appState : {
@@ -162,7 +162,7 @@ describe('withAuthenticationRequired', () => {
162162
163163 it ( 'should accept a returnTo function' , async ( ) => {
164164 mockClient . getUser . mockResolvedValue ( undefined ) ;
165- const MyComponent = ( ) : JSX . Element => < > Private</ > ;
165+ const MyComponent = ( ) => < > Private</ > ;
166166 const WrappedComponent = withAuthenticationRequired ( MyComponent , {
167167 returnTo : ( ) => '/foo' ,
168168 } ) ;
@@ -184,9 +184,9 @@ describe('withAuthenticationRequired', () => {
184184
185185 it ( 'should call loginWithRedirect only once even if parent state changes' , async ( ) => {
186186 mockClient . getUser . mockResolvedValue ( undefined ) ;
187- const MyComponent = ( ) : JSX . Element => < > Private</ > ;
187+ const MyComponent = ( ) => < > Private</ > ;
188188 const WrappedComponent = withAuthenticationRequired ( MyComponent ) ;
189- const App = ( { foo } : { foo : number } ) : JSX . Element => (
189+ const App = ( { foo } : { foo : number } ) => (
190190 < div >
191191 { foo }
192192 < Auth0Provider clientId = "__test_client_id__" domain = "__test_domain__" >
@@ -210,7 +210,7 @@ describe('withAuthenticationRequired', () => {
210210 mockClient . getUser . mockResolvedValueOnce ( { name : '__test_user__' } ) ;
211211 mockClient . getUser . mockResolvedValueOnce ( undefined ) ;
212212 const context = React . createContext < Auth0ContextInterface > ( initialContext ) ;
213- const MyComponent = ( ) : JSX . Element => < > Private</ > ;
213+ const MyComponent = ( ) => < > Private</ > ;
214214 const WrappedComponent = withAuthenticationRequired ( MyComponent , {
215215 context,
216216 } ) ;
@@ -241,7 +241,7 @@ describe('withAuthenticationRequired', () => {
241241 mockClient . getUser . mockResolvedValueOnce ( undefined ) ;
242242 mockClient . getUser . mockResolvedValueOnce ( { name : '__test_user__' } ) ;
243243 const context = React . createContext < Auth0ContextInterface > ( initialContext ) ;
244- const MyComponent = ( ) : JSX . Element => < > Private</ > ;
244+ const MyComponent = ( ) => < > Private</ > ;
245245 const WrappedComponent = withAuthenticationRequired ( MyComponent , {
246246 context,
247247 } ) ;
0 commit comments