Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
niladic committed Jan 22, 2025
1 parent 2cc1044 commit b1d8aae
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 21 deletions.
4 changes: 3 additions & 1 deletion test/browser/AnswerSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class AnswerSpec extends Specification with Tables with BaseSpec {
inseeCode = List("0"),
creationDate = Time.nowParis(),
areaIds = area :: Nil,
isInFranceServicesNetwork = true,
publicNote = None,
internalSupportComment = None
)
Expand Down Expand Up @@ -101,7 +102,8 @@ class AnswerSpec extends Specification with Tables with BaseSpec {
expertInvited = true,
mandatType = Some(Application.MandatType.Paper),
mandatDate = Some(java.time.ZonedDateTime.now().toString),
invitedGroupIdsAtCreation = List(group.id)
invitedGroupIdsAtCreation = List(group.id),
isInFranceServicesNetwork = group.isInFranceServicesNetwork,
)
val result = applicationService.createApplication(application)
result must beTrue
Expand Down
5 changes: 4 additions & 1 deletion test/browser/ApplicationAccessSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ class ApplicationAccessSpec extends Specification with BaseSpec {
inseeCode = List("0"),
creationDate = Time.nowParis(),
areaIds = area :: Nil,
isInFranceServicesNetwork = true,
publicNote = None,
internalSupportComment = None
)
Expand All @@ -144,6 +145,7 @@ class ApplicationAccessSpec extends Specification with BaseSpec {
inseeCode = List("0"),
creationDate = Time.nowParis(),
areaIds = area :: Nil,
isInFranceServicesNetwork = true,
publicNote = None,
internalSupportComment = None
)
Expand Down Expand Up @@ -357,7 +359,8 @@ class ApplicationAccessSpec extends Specification with BaseSpec {
irrelevant = false,
mandatType = Some(Application.MandatType.Paper),
mandatDate = Some(java.time.ZonedDateTime.now().toString),
invitedGroupIdsAtCreation = List(instructorGroup.id)
invitedGroupIdsAtCreation = List(instructorGroup.id),
isInFranceServicesNetwork = true,
)
applicationService.createApplication(application)

Expand Down
1 change: 1 addition & 0 deletions test/browser/ApplicationSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class ApplicationSpec extends Specification with BaseSpec {
inseeCode = List("0"),
creationDate = Time.nowParis(),
areaIds = area :: Nil,
isInFranceServicesNetwork = true,
publicNote = None,
internalSupportComment = None
)
Expand Down
1 change: 1 addition & 0 deletions test/csv/CSVSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class CSVSpec extends Specification {
areaIds = List(Area.fromId(UUIDHelper.namedFrom("ardennes"))).flatten.map(_.id),
organisationId = None,
email = Some("sip.laon@dgfip.finances.gouv.fr"),
isInFranceServicesNetwork = true,
publicNote = None,
internalSupportComment = None
)
Expand Down
27 changes: 18 additions & 9 deletions test/models/ApplicationSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ class ApplicationSpec extends Specification {
irrelevant = false,
mandatType = Option.empty[MandatType],
mandatDate = Option.empty[String],
invitedGroupIdsAtCreation = List.empty[UUID]
invitedGroupIdsAtCreation = List.empty[UUID],
isInFranceServicesNetwork = true,
)

application.newAnswersFor(userId) must equalTo(answers)
Expand Down Expand Up @@ -88,7 +89,8 @@ class ApplicationSpec extends Specification {
irrelevant = false,
mandatType = Option.empty[MandatType],
mandatDate = Option.empty[String],
invitedGroupIdsAtCreation = List.empty[UUID]
invitedGroupIdsAtCreation = List.empty[UUID],
isInFranceServicesNetwork = true,
)

application.newAnswersFor(userId) must equalTo(List(answer2))
Expand Down Expand Up @@ -123,7 +125,8 @@ class ApplicationSpec extends Specification {
irrelevant = false,
mandatType = Option.empty[MandatType],
mandatDate = Option.empty[String],
invitedGroupIdsAtCreation = List.empty[UUID]
invitedGroupIdsAtCreation = List.empty[UUID],
isInFranceServicesNetwork = true,
)

application.newAnswersFor(userId) must equalTo(List.empty[Answer])
Expand All @@ -150,7 +153,8 @@ class ApplicationSpec extends Specification {
irrelevant = false,
mandatType = Option.empty[MandatType],
mandatDate = Option.empty[String],
invitedGroupIdsAtCreation = List.empty[UUID]
invitedGroupIdsAtCreation = List.empty[UUID],
isInFranceServicesNetwork = true,
)

application.status must equalTo(Archived)
Expand Down Expand Up @@ -208,7 +212,8 @@ class ApplicationSpec extends Specification {
irrelevant = false,
mandatType = Option.empty[MandatType],
mandatDate = Option.empty[String],
invitedGroupIdsAtCreation = List.empty[UUID]
invitedGroupIdsAtCreation = List.empty[UUID],
isInFranceServicesNetwork = true,
)

application.status must equalTo(Processing)
Expand Down Expand Up @@ -265,7 +270,8 @@ class ApplicationSpec extends Specification {
irrelevant = false,
mandatType = Option.empty[MandatType],
mandatDate = Option.empty[String],
invitedGroupIdsAtCreation = List.empty[UUID]
invitedGroupIdsAtCreation = List.empty[UUID],
isInFranceServicesNetwork = true,
)

application.status must equalTo(New)
Expand All @@ -290,7 +296,8 @@ class ApplicationSpec extends Specification {
irrelevant = false,
mandatType = Option.empty[MandatType],
mandatDate = Option.empty[String],
invitedGroupIdsAtCreation = List.empty[UUID]
invitedGroupIdsAtCreation = List.empty[UUID],
isInFranceServicesNetwork = true,
)

application.hasBeenDisplayedFor(userId) must beTrue
Expand All @@ -314,7 +321,8 @@ class ApplicationSpec extends Specification {
irrelevant = false,
mandatType = Option.empty[MandatType],
mandatDate = Option.empty[String],
invitedGroupIdsAtCreation = List.empty[UUID]
invitedGroupIdsAtCreation = List.empty[UUID],
isInFranceServicesNetwork = true,
)

application.hasBeenDisplayedFor(userId) must beTrue
Expand All @@ -338,7 +346,8 @@ class ApplicationSpec extends Specification {
irrelevant = false,
mandatType = Option.empty[MandatType],
mandatDate = Option.empty[String],
invitedGroupIdsAtCreation = List.empty[UUID]
invitedGroupIdsAtCreation = List.empty[UUID],
isInFranceServicesNetwork = true,
)

application.hasBeenDisplayedFor(userId) must beFalse
Expand Down
30 changes: 20 additions & 10 deletions test/models/AuthorizationSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ class AuthorizationSpec extends Specification {
irrelevant = false,
mandatType = Option.empty[MandatType],
mandatDate = Option.empty[String],
invitedGroupIdsAtCreation = List.empty[UUID]
invitedGroupIdsAtCreation = List.empty[UUID],
isInFranceServicesNetwork = true,
)

val metadata = FileMetadata.Attached.Application(application.id)
Expand Down Expand Up @@ -95,7 +96,8 @@ class AuthorizationSpec extends Specification {
irrelevant = false,
mandatType = Option.empty[MandatType],
mandatDate = Option.empty[String],
invitedGroupIdsAtCreation = List.empty[UUID]
invitedGroupIdsAtCreation = List.empty[UUID],
isInFranceServicesNetwork = true,
)

val metadata = FileMetadata.Attached.Application(application.id)
Expand Down Expand Up @@ -128,7 +130,8 @@ class AuthorizationSpec extends Specification {
irrelevant = false,
mandatType = Option.empty[MandatType],
mandatDate = Option.empty[String],
invitedGroupIdsAtCreation = List.empty[UUID]
invitedGroupIdsAtCreation = List.empty[UUID],
isInFranceServicesNetwork = true,
)

val metadata = FileMetadata.Attached.Application(application.id)
Expand Down Expand Up @@ -166,7 +169,8 @@ class AuthorizationSpec extends Specification {
irrelevant = false,
mandatType = Option.empty[MandatType],
mandatDate = Option.empty[String],
invitedGroupIdsAtCreation = List.empty[UUID]
invitedGroupIdsAtCreation = List.empty[UUID],
isInFranceServicesNetwork = true,
)

val metadata = FileMetadata.Attached.Answer(application.id, answer.id)
Expand Down Expand Up @@ -201,7 +205,8 @@ class AuthorizationSpec extends Specification {
irrelevant = false,
mandatType = Option.empty[MandatType],
mandatDate = Option.empty[String],
invitedGroupIdsAtCreation = List.empty[UUID]
invitedGroupIdsAtCreation = List.empty[UUID],
isInFranceServicesNetwork = true,
)

val metadata = FileMetadata.Attached.Answer(application.id, answer.id)
Expand Down Expand Up @@ -243,7 +248,8 @@ class AuthorizationSpec extends Specification {
irrelevant = false,
mandatType = Option.empty[MandatType],
mandatDate = Option.empty[String],
invitedGroupIdsAtCreation = List.empty[UUID]
invitedGroupIdsAtCreation = List.empty[UUID],
isInFranceServicesNetwork = true,
)

val metadata = FileMetadata.Attached.Application(application.id)
Expand Down Expand Up @@ -278,7 +284,8 @@ class AuthorizationSpec extends Specification {
irrelevant = false,
mandatType = Option.empty[MandatType],
mandatDate = Option.empty[String],
invitedGroupIdsAtCreation = List.empty[UUID]
invitedGroupIdsAtCreation = List.empty[UUID],
isInFranceServicesNetwork = true,
)

val metadata = FileMetadata.Attached.Application(application.id)
Expand Down Expand Up @@ -311,7 +318,8 @@ class AuthorizationSpec extends Specification {
irrelevant = false,
mandatType = Option.empty[MandatType],
mandatDate = Option.empty[String],
invitedGroupIdsAtCreation = List.empty[UUID]
invitedGroupIdsAtCreation = List.empty[UUID],
isInFranceServicesNetwork = true,
)

val metadata = FileMetadata.Attached.Application(application.id)
Expand Down Expand Up @@ -349,7 +357,8 @@ class AuthorizationSpec extends Specification {
irrelevant = false,
mandatType = Option.empty[MandatType],
mandatDate = Option.empty[String],
invitedGroupIdsAtCreation = List.empty[UUID]
invitedGroupIdsAtCreation = List.empty[UUID],
isInFranceServicesNetwork = true,
)

val metadata = FileMetadata.Attached.Answer(application.id, answer.id)
Expand Down Expand Up @@ -384,7 +393,8 @@ class AuthorizationSpec extends Specification {
irrelevant = false,
mandatType = Option.empty[MandatType],
mandatDate = Option.empty[String],
invitedGroupIdsAtCreation = List.empty[UUID]
invitedGroupIdsAtCreation = List.empty[UUID],
isInFranceServicesNetwork = true,
)

val metadata = FileMetadata.Attached.Answer(application.id, answer.id)
Expand Down

0 comments on commit b1d8aae

Please sign in to comment.