(
client: QueryClient,
props: Partial<MainCommentProps> = {},
user: LoggedUser | undefined = undefined,
)
| 35 | }); |
| 36 | |
| 37 | const layout = ( |
| 38 | client: QueryClient, |
| 39 | props: Partial<MainCommentProps> = {}, |
| 40 | user: LoggedUser | undefined = undefined, |
| 41 | ): ReactElement => { |
| 42 | const defaultProps: MainCommentProps = { |
| 43 | post, |
| 44 | comment, |
| 45 | onDelete, |
| 46 | postAuthorId: null, |
| 47 | postScoutId: null, |
| 48 | onCommented: jest.fn(), |
| 49 | onShare: jest.fn(), |
| 50 | onShowUpvotes: jest.fn(), |
| 51 | origin: Origin.PostCommentButton, |
| 52 | }; |
| 53 | |
| 54 | return ( |
| 55 | <QueryClientProvider client={client}> |
| 56 | <AuthContext.Provider |
| 57 | value={{ |
| 58 | user, |
| 59 | shouldShowLogin: false, |
| 60 | showLogin: jest.fn(), |
| 61 | isLoggedIn: !!user, |
| 62 | logout: jest.fn(), |
| 63 | updateUser: jest.fn(), |
| 64 | closeLogin: jest.fn(), |
| 65 | getRedirectUri: jest.fn(), |
| 66 | tokenRefreshed: true, |
| 67 | isTokenValid: true, |
| 68 | isAuthReady: true, |
| 69 | isAuthReadyOrCached: true, |
| 70 | }} |
| 71 | > |
| 72 | <PaymentContextProvider> |
| 73 | <MainComment {...defaultProps} {...props} /> |
| 74 | </PaymentContextProvider> |
| 75 | </AuthContext.Provider> |
| 76 | </QueryClientProvider> |
| 77 | ); |
| 78 | }; |
| 79 | |
| 80 | const renderLayout = ( |
| 81 | props: Partial<MainCommentProps> = {}, |
no outgoing calls
no test coverage detected