@@ -3,6 +3,8 @@ import { SignInFactor } from '@clerk/types';
3
3
import { Session } from 'core/resources' ;
4
4
import React from 'react' ;
5
5
6
+ const mockUseOptions = jest . fn ( ( ) => ( { } ) ) ;
7
+
6
8
import { All } from './All' ;
7
9
8
10
jest . mock ( 'ui/contexts' , ( ) => {
@@ -13,6 +15,7 @@ jest.mock('ui/contexts', () => {
13
15
frontendAPI : 'clerk.clerk.dev' ,
14
16
} ,
15
17
} ) ) ,
18
+ useOptions : mockUseOptions ,
16
19
useEnvironment : jest . fn ( ( ) => ( {
17
20
displayConfig : {
18
21
theme : {
@@ -65,7 +68,18 @@ describe('<All/>', () => {
65
68
} ,
66
69
] ;
67
70
68
- it ( 'renders the All sign in methods' , async ( ) => {
71
+ it ( 'renders the All sign in methods' , ( ) => {
72
+ const tree = renderJSON (
73
+ < All
74
+ factors = { factors }
75
+ selectFactor = { jest . fn ( ) }
76
+ /> ,
77
+ ) ;
78
+ expect ( tree ) . toMatchSnapshot ( ) ;
79
+ } ) ;
80
+
81
+ it ( 'renders the All sign in methods with custom support email' , ( ) => {
82
+ mockUseOptions . mockImplementationOnce ( ( ) => ( { supportEmail : 'test@test.com' } ) ) ;
69
83
const tree = renderJSON (
70
84
< All
71
85
factors = { factors }
@@ -75,7 +89,7 @@ describe('<All/>', () => {
75
89
expect ( tree ) . toMatchSnapshot ( ) ;
76
90
} ) ;
77
91
78
- it ( 'triggers selectStrategy callback on click' , async ( ) => {
92
+ it ( 'triggers selectStrategy callback on click' , ( ) => {
79
93
const mockSelectStrategy = jest . fn ( ) ;
80
94
render (
81
95
< All
0 commit comments