11import { render , screen } from '@testing-library/react' ;
22import ThemeProvider from '#app/components/ThemeProvider' ;
33import { ServiceContextProvider } from '#app/contexts/ServiceContext' ;
4- import { AccountProvider } from '../AccountContext' ;
4+ import { AccountProvider } from '#contexts/AccountContext' ;
5+ import { IdctaConfig } from '#app/models/types/account' ;
56import AccountHeader from '.' ;
67
78const renderWithProviders = (
8- initialConfig : Parameters < typeof AccountProvider > [ 0 ] [ 'initialConfig' ] ,
9+ initialConfig = {
10+ 'id-availability' : 'GREEN' ,
11+ unavailable_url : 'https://example.com/unavailable' ,
12+ signin_url : 'https://example.com/signin' ,
13+ register_url : 'https://example.com/register' ,
14+ foryou_url : 'https://example.com/foryou' ,
15+ identity : {
16+ idSignedInCookieName : 'ckns_id' ,
17+ } ,
18+ } as IdctaConfig ,
919) =>
1020 render (
1121 < ServiceContextProvider service = "ws" >
@@ -19,14 +29,7 @@ const renderWithProviders = (
1929
2030describe ( 'AccountHeader' , ( ) => {
2131 it ( 'shows Sign in when signed out' , async ( ) => {
22- renderWithProviders ( {
23- availability : { signin : 'GREEN' } ,
24- unavailable_url : 'https://example.com/unavailable' ,
25- signin_url : 'https://example.com/signin' ,
26- register_url : 'https://example.com/register' ,
27- foryou_flagpole : 'GREEN' ,
28- foryou_url : 'https://example.com/foryou' ,
29- } ) ;
32+ renderWithProviders ( ) ;
3033
3134 const link = await screen . findByRole ( 'link' , { name : 'Sign in' } ) ;
3235 expect ( link ) . toHaveAttribute (
0 commit comments