Skip to content

Commit 6509247

Browse files
committed
✅ [open-formulieren/open-forms#3680] Updated tests/stories
1 parent 2c8907e commit 6509247

File tree

2 files changed

+33
-20
lines changed

2 files changed

+33
-20
lines changed

src/components/LoginOptions/LoginOptions.stories.js

+30-19
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ export default {
1717
};
1818

1919
export const Display = {
20-
render: ({loginAsYourselfOptions, loginAsGemachtigdeOptions}) => (
20+
render: ({loginAsYourselfOptions, loginAsGemachtigdeOptions, cosignLoginOptions}) => (
2121
<LoginOptionsDisplay
2222
loginAsYourselfOptions={loginAsYourselfOptions}
2323
loginAsGemachtigdeOptions={loginAsGemachtigdeOptions}
24+
cosignLoginOptions={cosignLoginOptions}
2425
/>
2526
),
2627
args: {
@@ -76,18 +77,26 @@ export const Display = {
7677
url: '#',
7778
},
7879
],
80+
cosignLoginOptions: [
81+
{
82+
identifier: 'digid',
83+
label: 'DigiD',
84+
logo: {
85+
appearance: 'dark',
86+
href: 'https://www.digid.nl/',
87+
title: 'DigiD',
88+
imageSrc: './digid.png',
89+
},
90+
url: '#',
91+
},
92+
],
7993
},
8094
};
8195

82-
const render = ({
83-
loginRequired = false,
84-
loginOptions = [],
85-
cosignLoginInfo = undefined,
86-
onFormStart,
87-
}) =>
96+
const render = ({loginRequired = false, loginOptions = [], cosignLoginOptions = [], onFormStart}) =>
8897
console.log(onFormStart) || (
8998
<LoginOptions
90-
form={buildForm({loginRequired, loginOptions, cosignLoginInfo})}
99+
form={buildForm({loginRequired, loginOptions, cosignLoginOptions})}
91100
onFormStart={onFormStart}
92101
/>
93102
);
@@ -214,17 +223,19 @@ export const WithCoSignOption = {
214223
isForGemachtigde: false,
215224
},
216225
],
217-
cosignLoginInfo: {
218-
identifier: 'digid',
219-
label: 'DigiD',
220-
url: '#',
221-
logo: {
222-
title: 'DigiD simulatie',
223-
imageSrc: './digid.png',
224-
href: 'https://www.digid.nl/',
225-
appearance: 'dark',
226+
cosignLoginOptions: [
227+
{
228+
identifier: 'digid',
229+
label: 'DigiD',
230+
url: '#',
231+
logo: {
232+
title: 'DigiD simulatie',
233+
imageSrc: './digid.png',
234+
href: 'https://www.digid.nl/',
235+
appearance: 'dark',
236+
},
237+
isForGemachtigde: false,
226238
},
227-
isForGemachtigde: false,
228-
},
239+
],
229240
},
230241
};

src/components/LoginOptions/tests.spec.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ afterEach(() => {
3030
});
3131

3232
it('Login not required, options wrapped in form tag', () => {
33-
const form = buildForm({loginRequired: false, loginOptions: []});
33+
const form = buildForm({loginRequired: false, loginOptions: [], cosignLoginOptions: []});
3434
const onFormStart = jest.fn(e => e.preventDefault());
3535

3636
act(() => {
@@ -67,6 +67,7 @@ it('Login required, options not wrapped in form tag', () => {
6767
isForGemachtigde: false,
6868
},
6969
],
70+
cosignLoginOptions: [],
7071
});
7172
const onFormStart = jest.fn(e => e.preventDefault());
7273

@@ -114,6 +115,7 @@ it('Login button has the right URL after cancelling log in', () => {
114115
isForGemachtigde: false,
115116
},
116117
],
118+
cosignLoginOptions: [],
117119
});
118120

119121
const onFormStart = jest.fn(e => e.preventDefault());

0 commit comments

Comments
 (0)