14
14
* See the License for the specific language governing permissions and
15
15
* limitations under the License.
16
16
*/
17
- 'use client'
18
-
19
- import { useState , useEffect } from 'react'
20
- import { testAuth , createTestAuthResult } from '../../../../lib/auth_test' ;
21
-
22
- export default function ClientResults ( ) {
23
- const [ testStatus , setTestStatus ] = useState ( "running..." ) ;
24
- const [ testAuthResult , setTestAuthResult ] = useState ( createTestAuthResult ( ) ) ;
25
- useEffect ( ( ) => {
26
- const asyncTest = async ( ) => {
27
- setTestAuthResult ( await testAuth ( ) ) ;
28
- setTestStatus ( "Complete!" ) ;
29
- }
30
- asyncTest ( ) . catch ( ( e ) => {
31
- console . error ( "Error encountered during testing: " , e ) ;
32
- setTestStatus ( "Errored!" ) ;
33
- } ) ;
34
- } , [ ] ) ;
35
-
17
+ import Link from 'next/link' ;
18
+ export default function AuthResultsDisplay ( { statusString, testAuthResult } ) {
36
19
return (
37
20
< >
38
- < h2 title = "testStatus" > Tests { testStatus } </ h2 >
21
+ < h2 title = "testStatus" > Tests { statusString } </ h2 >
39
22
< h4 title = "initializeAppResult" > initializeAppResult: { testAuthResult . initializeAppResult } </ h4 >
40
23
< h4 title = "signInAnonymouslyResult" > signInAnonymouslyResult: { testAuthResult . signInAnonymouslyResult } </ h4 >
41
24
< h4 title = "getTokenResult" > getTokenResult: { testAuthResult . getTokenResult } </ h4 >
@@ -45,6 +28,8 @@ export default function ClientResults() {
45
28
< h4 title = "deleteServerAppResult" > deleteServerAppResult: { testAuthResult . deleteServerAppResult } </ h4 >
46
29
< h4 title = "deleteUserResult" > deleteUserResult: { testAuthResult . deleteUserResult } </ h4 >
47
30
< h4 title = "deleteAppResult" > deleteAppResult: { testAuthResult . deleteAppResult } </ h4 >
31
+ < p />
32
+ < Link href = "/" > Back to test index</ Link >
48
33
</ >
49
34
) ;
50
35
}
0 commit comments