Skip to content

Commit

Permalink
[TRELLO-2037] Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
charlescd committed Oct 18, 2023
1 parent 37fa3d8 commit a803e01
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions test/controllers/report/ReportRepositoryMock.scala
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class ReportRepositoryMock(database: mutable.Map[UUID, Report] = mutable.Map.emp
override def cloudWord(companyId: UUID): Future[List[ReportWordOccurrence]] = ???

override def reportsCountBySubcategories(
userRole: UserRole,
filters: ReportsCountBySubcategoriesFilter,
lang: Locale
): Future[Seq[(String, List[String], Int, Int)]] = ???
Expand Down
23 changes: 22 additions & 1 deletion test/repositories/ReportRepositorySpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,36 @@ class ReportRepositorySpec(implicit ee: ExecutionEnv)
"fetch french jobs" in {
for {
res <- components.reportRepository.reportsCountBySubcategories(
UserRole.Admin,
ReportsCountBySubcategoriesFilter(),
Locale.FRENCH
)
} yield res should contain(
("AchatInternet", List("a", "b", "c"), 1, 0),
("AchatInternet", List("a", "b", "d"), 1, 0),
("AchatMagasin", List("a", "b", "c"), 3, 1)
("AchatMagasin", List("a", "b", "c"), 3, 1),
("IntoxicationAlimentaire", List("a"), 1, 0)
)
}

"filter results when user is DGAL" in {
for {
res <- components.reportRepository.reportsCountBySubcategories(
UserRole.DGAL,
ReportsCountBySubcategoriesFilter(),
Locale.FRENCH
)
} yield {
res should not(
contain(
("AchatInternet", List("a", "b", "c"), 1, 0),
("AchatInternet", List("a", "b", "d"), 1, 0),
("AchatMagasin", List("a", "b", "c"), 3, 1)
)
)
res should contain(("IntoxicationAlimentaire", List("a"), 1, 0))
}
}
}

"getPhoneReports" in {
Expand Down

0 comments on commit a803e01

Please sign in to comment.