-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: do not display empty respondents lists
- Loading branch information
1 parent
7f4d800
commit 43dfa63
Showing
4 changed files
with
59 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { convertOldPersonalization } from './convertOldPersonalization' | ||
|
||
test.each([ | ||
[undefined, undefined], | ||
[[], undefined], | ||
[[{ name: 'invalid-key', value: 'Three-headed monkey' }], undefined], | ||
[ | ||
[ | ||
{ name: 'whoAnswers1', value: 'Guybrush Threepwood' }, | ||
{ name: 'whoAnswers2', value: 'Three-headed monkey' }, | ||
], | ||
[ | ||
{ | ||
title: 'Qui doit répondre à ce questionnaire ?', | ||
contentBlocks: [ | ||
{ | ||
type: 'list', | ||
textItems: ['Guybrush Threepwood', 'Three-headed monkey'], | ||
}, | ||
], | ||
}, | ||
], | ||
], | ||
[ | ||
[ | ||
{ name: 'whoAnswers1', value: 'Guybrush Threepwood' }, | ||
{ name: 'invalid-key', value: 'Three-headed monkey' }, | ||
], | ||
[ | ||
{ | ||
title: 'Qui doit répondre à ce questionnaire ?', | ||
contentBlocks: [ | ||
{ | ||
type: 'list', | ||
textItems: ['Guybrush Threepwood'], | ||
}, | ||
], | ||
}, | ||
], | ||
], | ||
])('Convert old personalization', (input, res) => { | ||
expect(convertOldPersonalization(input)).toEqual(res) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters