Skip to content

Commit

Permalink
Clean tests
Browse files Browse the repository at this point in the history
  • Loading branch information
quentinovega committed Dec 13, 2024
1 parent 7561605 commit 4dfdd46
Showing 1 changed file with 0 additions and 42 deletions.
42 changes: 0 additions & 42 deletions daikoku/test/daikoku/TeamControllerSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -77,31 +77,6 @@ class TeamControllerSpec()
respDeleteNotFound.status mustBe 404
}

"not ask join a personal team" in {
setupEnvBlocking(
tenants = Seq(tenant),
users = Seq(daikokuAdmin, user),
teams = Seq(teamOwner)
)
val dkAdminSession = loginWithBlocking(daikokuAdmin, tenant)
val userSession = loginWithBlocking(user, tenant)

val respMyTeam =
httpJsonCallBlocking("/api/me/teams/own")(tenant, userSession)
respMyTeam.status mustBe 200
val userTeam =
fr.maif.otoroshi.daikoku.domain.json.TeamFormat.reads(respMyTeam.json)
userTeam.isSuccess mustBe true
val userTeamId = userTeam.get.id

val respJoinDenied = httpJsonCallBlocking(
path = s"/api/teams/${userTeamId.value}/join",
method = "POST"
)(tenant, dkAdminSession)

respJoinDenied.status mustBe 403
}

"not add/remove member from a personal team" in {
setupEnvBlocking(
tenants = Seq(tenant),
Expand Down Expand Up @@ -876,23 +851,6 @@ class TeamControllerSpec()
respUpdateNotFound.status mustBe 403
}

"not be join by anyone" in {
setupEnvBlocking(
tenants = Seq(tenant),
users = Seq(daikokuAdmin, user),
teams = Seq(defaultAdminTeam),
apis = Seq(adminApi)
)

val session = loginWithBlocking(user, tenant)

val respUser = httpJsonCallBlocking(
path = s"/api/teams/${defaultAdminTeam.id.value}/join",
method = "POST"
)(tenant, session)
respUser.status mustBe 403
}

"not be visible by user which is not member" in {
setupEnvBlocking(
tenants = Seq(tenant),
Expand Down

0 comments on commit 4dfdd46

Please sign in to comment.