-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate enrollment reducer to typescript
- Loading branch information
Pierre-Eric Garcia
committed
Aug 11, 2023
1 parent
7f3a02a
commit 7423c12
Showing
10 changed files
with
109 additions
and
71 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
1 change: 0 additions & 1 deletion
1
frontend/src/components/templates/DataProviderList/ApiDataProviderList.tsx
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
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 |
---|---|---|
@@ -1,29 +1,38 @@ | ||
import { EnrollmentEvent } from '../../../config/event-configuration'; | ||
import { EnrollmentStatus } from '../../../config/status-parameters'; | ||
import { TeamMemberType } from '../InstructorEnrollmentList'; | ||
import enrollmentReducerFactory from './enrollmentReducer'; | ||
|
||
describe('enrollmentReducerFactory', () => { | ||
const previousEnrollment = { | ||
id: 1, | ||
acl: { | ||
update: true, | ||
submit: true, | ||
[EnrollmentEvent.update]: true, | ||
[EnrollmentEvent.submit]: true, | ||
}, | ||
status: 'draft', | ||
status: EnrollmentStatus.draft, | ||
target_api: 'api_particulier', | ||
scopes: { | ||
dgfip_declarant1_nom: false, | ||
cnaf_quotient_familial: false, | ||
}, | ||
updated_at: 'now', | ||
created_at: 'now', | ||
team_members: [ | ||
{ | ||
type: 'demandeur', | ||
id: 1, | ||
type: TeamMemberType.demandeur, | ||
tmp_id: 'tmp_31', | ||
email: '[email protected]', | ||
}, | ||
{ | ||
type: 'responsable_technique', | ||
id: 2, | ||
type: TeamMemberType.responsable_technique, | ||
tmp_id: 'tmp_34', | ||
}, | ||
], | ||
}; | ||
|
||
describe('enrollmentReducer with no demarches', () => { | ||
const enrollmentReducer = enrollmentReducerFactory(null); | ||
|
||
|
@@ -65,7 +74,8 @@ describe('enrollmentReducerFactory', () => { | |
}; | ||
|
||
expect( | ||
enrollmentReducer(previousEnrollment, event).scopes.dgfip_declarant1_nom | ||
enrollmentReducer(previousEnrollment, event)?.scopes | ||
?.dgfip_declarant1_nom | ||
).toEqual(true); | ||
}); | ||
|
||
|
@@ -235,13 +245,15 @@ describe('enrollmentReducerFactory', () => { | |
).toEqual([ | ||
{ | ||
type: 'demandeur', | ||
id: 1, | ||
email: '[email protected]', | ||
tmp_id: 'tmp_31', | ||
}, | ||
{ | ||
type: 'responsable_technique', | ||
email: '[email protected]', | ||
tmp_id: 'tmp_34', | ||
id: 2, | ||
}, | ||
]); | ||
}); | ||
|
@@ -261,13 +273,15 @@ describe('enrollmentReducerFactory', () => { | |
).toEqual([ | ||
{ | ||
type: 'demandeur', | ||
id: 1, | ||
email: '[email protected]', | ||
tmp_id: 'tmp_31', | ||
}, | ||
{ | ||
type: 'responsable_technique', | ||
email: '', | ||
tmp_id: 'tmp_34', | ||
id: 2, | ||
}, | ||
]); | ||
}); | ||
|
@@ -317,11 +331,13 @@ describe('enrollmentReducerFactory', () => { | |
type: 'demandeur', | ||
email: '[email protected]', | ||
tmp_id: 'tmp_31', | ||
id: 1, | ||
}, | ||
{ | ||
type: 'responsable_technique', | ||
email: '', | ||
tmp_id: 'tmp_34', | ||
id: 2, | ||
}, | ||
]); | ||
}); | ||
|
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
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
Oops, something went wrong.