File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ describe("RatingService", () => {
217217
218218 describe ( "getRatingResults" , ( ) => {
219219 it ( "aggregates ratings for two projects with two ratings each" , async ( ) => {
220- expect . assertions ( 5 ) ;
220+ expect . assertions ( 6 ) ;
221221
222222 const projectA = await projectRepo . save (
223223 Object . assign ( new Project ( ) , {
@@ -271,16 +271,12 @@ describe("RatingService", () => {
271271
272272 const resultA = results . find ( ( r ) => r . project . id === projectA . id ) ! ;
273273 expect ( resultA ) . toBeDefined ( ) ;
274- expect ( resultA . criterionIdToAvg ) . toEqual ( {
275- [ criterionA . id ] : 2.5 ,
276- [ criterionB . id ] : 1 ,
277- } ) ;
274+ expect ( resultA . averagesPerCriterion [ 0 ] . average ) . toEqual ( 2.5 )
275+ expect ( resultA . averagesPerCriterion [ 1 ] . average ) . toEqual ( 1 )
278276
279277 const resultB = results . find ( ( r ) => r . project . id === projectB . id ) ! ;
280278 expect ( resultB ) . toBeDefined ( ) ;
281- expect ( resultB . criterionIdToAvg ) . toEqual ( {
282- [ criterionB . id ] : 4 ,
283- } ) ;
279+ expect ( resultB . averagesPerCriterion [ 0 ] . average ) . toEqual ( 4 ) ;
284280 } ) ;
285281 } ) ;
286282} ) ;
You can’t perform that action at this time.
0 commit comments