Skip to content

Commit 2b850a5

Browse files
committed
test: fix test
1 parent 4356d8f commit 2b850a5

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

src/app/components/Account/AccountHeader/index.test.tsx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
import { render, screen } from '@testing-library/react';
22
import ThemeProvider from '#app/components/ThemeProvider';
33
import { ServiceContextProvider } from '#app/contexts/ServiceContext';
4-
import { AccountProvider } from '../AccountContext';
4+
import { AccountProvider } from '#contexts/AccountContext';
5+
import { IdctaConfig } from '#app/models/types/account';
56
import AccountHeader from '.';
67

78
const 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

2030
describe('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

Comments
 (0)