-
Notifications
You must be signed in to change notification settings - Fork 555
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
389 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,3 +94,4 @@ static/src/stylesheets/pasteup/.npmrc | |
metals.sbt | ||
|
||
.java-version | ||
test-results/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,7 @@ trait ABTestSwitches { | |
"Test the Opt Out frequency capping feature", | ||
owners = Seq(Owner.withEmail("[email protected]")), | ||
safeState = Off, | ||
sellByDate = Some(LocalDate.of(2024, 12, 2)), | ||
sellByDate = Some(LocalDate.of(2025, 1, 29)), | ||
exposeClientSide = true, | ||
highImpact = false, | ||
) | ||
|
@@ -71,16 +71,6 @@ trait ABTestSwitches { | |
highImpact = false, | ||
) | ||
|
||
Switch( | ||
ABTests, | ||
"ab-new-header-bidding-endpoint", | ||
"Test new header bidding (prebid) analytics endpoint", | ||
owners = Seq(Owner.withEmail("[email protected]")), | ||
safeState = Off, | ||
sellByDate = Some(LocalDate.of(2024, 12, 2)), | ||
exposeClientSide = true, | ||
highImpact = false, | ||
) | ||
Switch( | ||
ABTests, | ||
"ab-gpid-prebid-ad-units", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -567,9 +567,9 @@ trait FeatureSwitches { | |
group = SwitchGroup.Feature, | ||
name = "disable-front-container-show-hide", | ||
description = "For users with no currently hidden containers on a front, removes the ability to hide containers", | ||
owners = Seq(Owner.withGithub("cemms1")), | ||
owners = Seq(Owner.withEmail("[email protected]")), | ||
safeState = On, | ||
sellByDate = LocalDate.of(2024, 11, 29), | ||
sellByDate = LocalDate.of(2025, 2, 4), | ||
exposeClientSide = true, | ||
highImpact = false, | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
common/test/model/dotcomrendering/EditionsCrosswordRenderingDataModelTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
package model.dotcomrendering | ||
|
||
import com.gu.contentapi.client.model.v1.{CapiDateTime, Crossword, CrosswordType, CrosswordDimensions, CrosswordEntry} | ||
import model.dotcomrendering.pageElements.EditionsCrosswordRenderingDataModel | ||
import org.mockito.Mockito.when | ||
import org.scalatest.flatspec.AnyFlatSpec | ||
import org.scalatest.matchers.should.Matchers | ||
import org.scalatestplus.mockito.MockitoSugar | ||
import org.joda.time.DateTime | ||
|
||
class EditionsCrosswordRenderingDataModelTest extends AnyFlatSpec with Matchers with MockitoSugar { | ||
val mockEntry = CrosswordEntry( | ||
id = "mockId", | ||
solution = Some("Mock solution"), | ||
) | ||
|
||
val mockCrossword = Crossword( | ||
name = "Mock name", | ||
`type` = CrosswordType.Quick, | ||
number = 1, | ||
date = CapiDateTime(DateTime.now().getMillis(), "date"), | ||
dimensions = CrosswordDimensions(1, 1), | ||
entries = Seq(mockEntry, mockEntry), | ||
solutionAvailable = true, | ||
hasNumbers = false, | ||
randomCluesOrdering = false, | ||
) | ||
|
||
"apply" should "provide solutions when 'dateSolutionAvailable' is in the past" in { | ||
val crossword = mockCrossword.copy( | ||
solutionAvailable = true, | ||
dateSolutionAvailable = Some(CapiDateTime(DateTime.now().minusDays(1).getMillis(), "date")), | ||
) | ||
|
||
val crosswords = | ||
EditionsCrosswordRenderingDataModel(Seq(crossword, crossword)).crosswords.toSeq | ||
|
||
crosswords(0).entries(0).solution shouldBe Some("Mock solution") | ||
crosswords(0).entries(1).solution shouldBe Some("Mock solution") | ||
crosswords(1).entries(0).solution shouldBe Some("Mock solution") | ||
crosswords(1).entries(1).solution shouldBe Some("Mock solution") | ||
} | ||
|
||
"apply" should "provide solutions when 'dateSolutionAvailable' is 'None' and solutionAvailable is 'true'" in { | ||
val crossword = mockCrossword.copy( | ||
solutionAvailable = true, | ||
dateSolutionAvailable = None, | ||
) | ||
|
||
val crosswords = | ||
EditionsCrosswordRenderingDataModel(Seq(crossword, crossword)).crosswords.toSeq | ||
|
||
crosswords(0).entries(0).solution shouldBe Some("Mock solution") | ||
crosswords(0).entries(1).solution shouldBe Some("Mock solution") | ||
crosswords(1).entries(0).solution shouldBe Some("Mock solution") | ||
crosswords(1).entries(1).solution shouldBe Some("Mock solution") | ||
} | ||
|
||
"apply" should "not provide solutions when 'dateSolutionAvailable' is in the future" in { | ||
val crossword = mockCrossword.copy( | ||
solutionAvailable = true, | ||
dateSolutionAvailable = Some(CapiDateTime(DateTime.now().plusDays(1).getMillis(), "date")), | ||
) | ||
|
||
val crosswords = | ||
EditionsCrosswordRenderingDataModel(Seq(crossword, crossword)).crosswords.toSeq | ||
|
||
crosswords(0).entries(0).solution shouldBe None | ||
crosswords(0).entries(1).solution shouldBe None | ||
crosswords(1).entries(0).solution shouldBe None | ||
crosswords(1).entries(1).solution shouldBe None | ||
} | ||
|
||
"apply" should "not provide solutions when 'dateSolutionAvailable' is 'None' and solutionAvailable is 'false'" in { | ||
val crossword = mockCrossword.copy( | ||
solutionAvailable = false, | ||
dateSolutionAvailable = None, | ||
) | ||
|
||
val crosswords = | ||
EditionsCrosswordRenderingDataModel(Seq(crossword, crossword)).crosswords.toSeq | ||
|
||
crosswords(0).entries(0).solution shouldBe None | ||
crosswords(0).entries(1).solution shouldBe None | ||
crosswords(1).entries(0).solution shouldBe None | ||
crosswords(1).entries(1).solution shouldBe None | ||
} | ||
} |
Oops, something went wrong.