Skip to content

Commit

Permalink
test(association-manager): make unit tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurelien9Code committed Dec 20, 2024
1 parent 6f7cf49 commit 5eafdb3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class AssociationRepositoryFirestoreTest {
association1 =
MockAssociation.createMockAssociation(
category = AssociationCategory.SCIENCE_TECH,
members = listOf(Member(User.emptyFirestoreReferenceElement(), Role.ADMIN)))
members = listOf(Member(User.emptyFirestoreReferenceElement(), Role.ADMIN.uid)))
association2 =
MockAssociation.createMockAssociation(category = AssociationCategory.SCIENCE_TECH)

Expand Down Expand Up @@ -151,21 +151,22 @@ class AssociationRepositoryFirestoreTest {
"description" to association1.description,
"members" to
mapOf(
"1" to "Guest",
"2" to "Guest"), // the serialization process does not allow us to simply put
"1" to "GUESTUID",
"2" to "GUESTUID"), // the serialization process does not allow us to simply put
// association1.members
"roles" to
mapOf(
"Guest" to
mapOf(
"displayName" to "Guest",
"color" to badgeColorBlue,
"permissions" to listOf("Full rights")),
"permissions" to listOf("Full Rights")
),
"Administrator" to
mapOf(
"displayName" to "Administrator",
"color" to badgeColorCyan,
"permissions" to listOf("Full rights"))),
"permissions" to listOf("Full Rights"))),
"followersCount" to association1.followersCount,
"image" to association1.image,
"events" to association1.events.uids,
Expand All @@ -179,19 +180,19 @@ class AssociationRepositoryFirestoreTest {
"fullName" to association2.fullName,
"category" to association2.category.name,
"description" to association2.description,
"members" to mapOf("1" to "Guest", "2" to "Guest"),
"members" to mapOf("1" to "GUESTUID", "2" to "GUESTUID"),
"roles" to
mapOf(
"Guest" to
mapOf(
"displayName" to "Guest",
"color" to badgeColorBlue,
"permissions" to listOf("Full rights")),
"permissions" to listOf("Full Rights")),
"Administrator" to
mapOf(
"displayName" to "Administrator",
"color" to badgeColorCyan,
"permissions" to listOf("Full rights"))),
"permissions" to listOf("Full Rights"))),
"followersCount" to association2.followersCount,
"image" to association2.image,
"events" to association2.events.uids,
Expand Down Expand Up @@ -282,7 +283,7 @@ class AssociationRepositoryFirestoreTest {
fullName = "",
category = AssociationCategory.ARTS,
description = "",
members = listOf(Member(User.emptyFirestoreReferenceElement(), Role.GUEST)),
members = listOf(Member(User.emptyFirestoreReferenceElement(), Role.GUEST.uid)),
roles = listOf(Role.GUEST),
followersCount = 0,
image = "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class HydrationAndSerializationTest {
fullName = "Example Association",
category = AssociationCategory.ARTS,
description = "An example association",
members = listOf(Member(User.firestoreReferenceElementWith("1"), Role.GUEST)),
members = listOf(Member(User.firestoreReferenceElementWith("1"), Role.GUEST.uid)),
roles = listOf(Role.GUEST),
followersCount = 0,
image = "https://www.example.com/image.jpg",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class SearchRepositoryTest {
category = AssociationCategory.SCIENCE_TECH,
description = "ACM is the world's largest educational and scientific computing society.",
followersCount = 1,
members = listOf(Member(User.firestoreReferenceElementWith("1"), Role.GUEST)),
members = listOf(Member(User.firestoreReferenceElementWith("1"), Role.GUEST.uid)),
roles = listOf(Role.GUEST),
image = "https://www.example.com/image.jpg",
events = Event.firestoreReferenceListWith(listOf("1", "2")),
Expand All @@ -106,7 +106,7 @@ class SearchRepositoryTest {
description =
"IEEE is the world's largest technical professional organization dedicated to advancing technology for the benefit of humanity.",
followersCount = 1,
members = listOf(Member(User.firestoreReferenceElementWith("2"), Role.GUEST)),
members = listOf(Member(User.firestoreReferenceElementWith("2"), Role.GUEST.uid)),
roles = listOf(Role.GUEST),
image = "https://www.example.com/image.jpg",
events = Event.firestoreReferenceListWith(listOf("3", "4")),
Expand Down

0 comments on commit 5eafdb3

Please sign in to comment.