Skip to content

Commit

Permalink
test: make them pass
Browse files Browse the repository at this point in the history
  • Loading branch information
mxdvl committed Jun 13, 2024
1 parent f9d3e78 commit 51d2ac3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sport/app/football/controllers/FixturesController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class FixturesController(
contentApiClient
.getResponse(contentApiClient.item(id, edition))
.map(_.interactive.map(InteractiveAtom.make(_)))
.recover{ case _ => None}
.recover { case _ => None }
.map(renderMatchList(page, fixtures, filters, _))
case _ =>
Future.successful(renderMatchList(page, fixtures, filters, None))
Expand Down
2 changes: 1 addition & 1 deletion sport/app/football/controllers/MatchDayController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class MatchDayController(
contentApiClient
.getResponse(contentApiClient.item(id, edition))
.map(_.interactive.map(InteractiveAtom.make(_)))
.recover{ case _ => None}
.recover { case _ => None }
.map(renderMatchList(page, matches, filters, _))
} else Future.successful(renderMatchList(page, matches, filters, None))
}
Expand Down
2 changes: 1 addition & 1 deletion sport/app/football/controllers/MatchListController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ trait MatchListController extends BaseController with Requests {
"html" -> football.views.html.matchList.matchesComponent(matchesList),
"next" -> Html(matchesList.nextPage.getOrElse("")),
"previous" -> Html(matchesList.previousPage.getOrElse("")),
"atom" -> atom,
"atom" -> atom.isDefined,
)
else
RevalidatableResult.Ok(football.views.html.matchList.matchesPage(page, matchesList, filters, atom))
Expand Down
5 changes: 3 additions & 2 deletions sport/test/LeagueTablesFeatureTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import org.scalatest.matchers.should.Matchers
with BeforeAndAfterAll
with WithMaterializer
with WithTestApplicationContext
with WithTestWsClient {
with WithTestWsClient
with WithTestContentApiClient {

Feature("League Tables") {

Expand Down Expand Up @@ -67,7 +68,7 @@ import org.scalatest.matchers.should.Matchers

Scenario("Should redirect when no competition table data found") {
val leagueTableController =
new LeagueTableController(testCompetitionsService, play.api.test.Helpers.stubControllerComponents())
new LeagueTableController(testCompetitionsService, play.api.test.Helpers.stubControllerComponents(), testContentApiClient)
val result = leagueTableController.renderCompetition("sfgsfgsfg")(FakeRequest())
status(result) should be(303)
}
Expand Down
5 changes: 3 additions & 2 deletions sport/test/controllers/LeagueTableControllerTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ import org.scalatest.{BeforeAndAfterAll, DoNotDiscover}
with BeforeAndAfterAll
with WithTestApplicationContext
with WithTestExecutionContext
with WithTestWsClient {
with WithTestWsClient
with WithTestContentApiClient {

lazy val leagueTableController =
new LeagueTableController(testCompetitionsService, play.api.test.Helpers.stubControllerComponents())
new LeagueTableController(testCompetitionsService, play.api.test.Helpers.stubControllerComponents(), testContentApiClient)

"League Table Controller" should "200 when content type is table" in {
val result = leagueTableController.renderLeagueTables()(TestRequest())
Expand Down

0 comments on commit 51d2ac3

Please sign in to comment.