Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HIPP-1707: Increase number of hip environments in tests #518

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion test-utils/fakes/FakeHipEnvironments.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,27 @@ object FakeHipEnvironments extends HipEnvironments {
isProductionLike = false
)

override val environments: Seq[HipEnvironment] = Seq(production, test)
val huey: HipEnvironment = HipEnvironment(
id = "Huey",
rank = 3,
nameKey = "hipEnvironment.test.name",
isProductionLike = false
)

val louis: HipEnvironment = HipEnvironment(
id = "Louis",
rank = 4,
nameKey = "hipEnvironment.test.name",
isProductionLike = false
)

val dewey: HipEnvironment = HipEnvironment(
id = "Dewey",
rank = 5,
nameKey = "hipEnvironment.test.name",
isProductionLike = false
)

override val environments: Seq[HipEnvironment] = Seq(production, test, huey, louis, dewey)

}
2 changes: 1 addition & 1 deletion test/services/CurlCommandServiceSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class CurlCommandServiceSpec extends SpecBase with MockitoSugar {

"must return the correct curl commands if the oas file can be parsed" in {
val service = new CurlCommandService(FakeHipEnvironments)
val credential = Credential("client-id", LocalDateTime.now, Some("client-secret"), None, FakeHipEnvironments.test.id)
val credential = Credential("client-id", LocalDateTime.now, Some("client-secret"), None, FakeHipEnvironments.dewey.id)
val validOas =
"""
|---
Expand Down
18 changes: 18 additions & 0 deletions test/viewmodels/application/ApplicationNavItemsSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,24 @@ class ApplicationNavItemsSpec extends SpecBase with Matchers with TestHelpers wi
title = "Test environment",
link = controllers.application.routes.EnvironmentsController.onPageLoad(FakeApplication.id, FakeHipEnvironments.test.id),
isCurrentPage = false,
),
SideNavItemLeaf(
page = EnvironmentPage(FakeHipEnvironments.huey),
title = "site.environment.Huey",
link = controllers.application.routes.EnvironmentsController.onPageLoad(FakeApplication.id, FakeHipEnvironments.huey.id),
isCurrentPage = false,
),
SideNavItemLeaf(
page = EnvironmentPage(FakeHipEnvironments.louis),
title = "site.environment.Louis",
link = controllers.application.routes.EnvironmentsController.onPageLoad(FakeApplication.id, FakeHipEnvironments.louis.id),
isCurrentPage = false,
),
SideNavItemLeaf(
page = EnvironmentPage(FakeHipEnvironments.dewey),
title = "site.environment.Dewey",
link = controllers.application.routes.EnvironmentsController.onPageLoad(FakeApplication.id, FakeHipEnvironments.dewey.id),
isCurrentPage = false,
)
)
),
Expand Down