@@ -88,7 +88,7 @@ module('Integration | Components | Routes | Campaigns | Assessment | Evaluation
88
88
89
89
module ( 'when the campaign has not been shared yet and has trainings' , function ( ) {
90
90
module ( 'when clicking on the share results button' , function ( ) {
91
- test ( 'it should display the evaluation-sent-results modal' , async function ( assert ) {
91
+ test ( 'it should display the evaluation-sent-results modal with first 3 trainings ' , async function ( assert ) {
92
92
// given
93
93
class FeatureTogglesStub extends Service {
94
94
featureToggles = { isModalSentResultEnabled : true } ;
@@ -125,6 +125,16 @@ module('Integration | Components | Routes | Campaigns | Assessment | Evaluation
125
125
editorLogoUrl :
126
126
'https://images.pix.fr/contenu-formatif/editeur/logo-ministere-education-nationale-et-jeunesse.svg' ,
127
127
} ,
128
+ {
129
+ title : 'Mon super training 4 youhou' ,
130
+ link : 'https://training.net/' ,
131
+ type : 'webinaire' ,
132
+ locale : 'fr-fr' ,
133
+ duration : { hours : 6 } ,
134
+ editorName : "Ministère de l'éducation nationale et de la jeunesse. Liberté égalité fraternité" ,
135
+ editorLogoUrl :
136
+ 'https://images.pix.fr/contenu-formatif/editeur/logo-ministere-education-nationale-et-jeunesse.svg' ,
137
+ } ,
128
138
] ;
129
139
this . model . campaignParticipationResult . isShared = false ;
130
140
this . model . campaignParticipationResult . competenceResults = [ Symbol ( 'competences' ) ] ;
@@ -137,12 +147,19 @@ module('Integration | Components | Routes | Campaigns | Assessment | Evaluation
137
147
// when
138
148
screen = await render ( hbs `<Routes::Campaigns::Assessment::EvaluationResults @model={{this.model}} />` ) ;
139
149
await click ( screen . queryByRole ( 'tab' , { name : 'Formations' } ) ) ;
140
- const dialog = await screen . getByRole ( 'dialog' ) ;
141
- await click ( within ( dialog ) . queryByRole ( 'button' , { name : t ( 'pages.skill-review.actions.send' ) } ) ) ;
150
+ const trainingsDialog = await screen . getByRole ( 'dialog' ) ;
151
+ await click ( within ( trainingsDialog ) . queryByRole ( 'button' , { name : t ( 'pages.skill-review.actions.send' ) } ) ) ;
142
152
await waitForDialogClose ( ) ;
153
+ const sharedResultsModal = await screen . getByRole ( 'dialog' , { name : 'Résultats partagés' } ) ;
143
154
144
155
// then
145
156
assert . dom ( await screen . findByRole ( 'button' , { name : 'Fermer et revenir aux résultats' } ) ) . exists ( ) ;
157
+ assert
158
+ . dom ( within ( sharedResultsModal ) . queryByRole ( 'heading' , { level : 3 , name : 'Mon super training 1 youhou' } ) )
159
+ . exists ( ) ;
160
+ assert
161
+ . dom ( within ( sharedResultsModal ) . queryByRole ( 'heading' , { level : 3 , name : 'Mon super training 4 youhou' } ) )
162
+ . doesNotExist ( ) ;
146
163
} ) ;
147
164
148
165
module ( 'when feature_toggle ‘isModalSentResultEnabled‘ is false' , function ( ) {
0 commit comments