-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from guardian/sponsorship-package
Add alternative wording for US and US Exclusive sponsorship packages
- Loading branch information
Showing
5 changed files
with
41 additions
and
12 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
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 |
---|---|---|
@@ -1,40 +1,56 @@ | ||
package com.gu.commercial.branding | ||
|
||
import com.gu.contentapi.client.model.v1.SponsorshipType | ||
import com.gu.contentapi.client.model.v1.{SponsorshipPackage, SponsorshipType} | ||
import org.scalatest.{FlatSpec, Matchers, OptionValues} | ||
|
||
class LogoSpec extends FlatSpec with Matchers with OptionValues { | ||
|
||
private def mkLogo(sponsorshipType: SponsorshipType, webTitle: String = "") = Logo.make( | ||
private def mkLogo(sponsorshipType: SponsorshipType, sponsorshipPackage: Option[SponsorshipPackage], webTitle: String = "") = Logo.make( | ||
title = webTitle, | ||
sponsorshipType = sponsorshipType, | ||
sponsorshipPackage = sponsorshipPackage, | ||
src = "src", | ||
dimensions = None, | ||
link = "link" | ||
) | ||
|
||
"make" should "generate the correct label for sponsored content" in { | ||
val logo = mkLogo(SponsorshipType.Sponsored) | ||
"make" should "generate the correct label for sponsored content with unspecified sponsorship package" in { | ||
val logo = mkLogo(SponsorshipType.Sponsored, None) | ||
logo.label shouldBe "Supported by" | ||
} | ||
|
||
"make" should "generate the correct label for sponsored content with default sponsorship package" in { | ||
val logo = mkLogo(SponsorshipType.Sponsored, Some(SponsorshipPackage.Default)) | ||
logo.label shouldBe "Supported by" | ||
} | ||
|
||
"make" should "generate the correct label for sponsored content with US sponsorship package" in { | ||
val logo = mkLogo(SponsorshipType.Sponsored, Some(SponsorshipPackage.Us)) | ||
logo.label shouldBe "Advertising partner" | ||
} | ||
|
||
"make" should "generate the correct label for sponsored content with US exclusive package" in { | ||
val logo = mkLogo(SponsorshipType.Sponsored, Some(SponsorshipPackage.UsExclusive)) | ||
logo.label shouldBe "Exclusive advertising partner" | ||
} | ||
|
||
it should "generate the correct label for paid content" in { | ||
val logo = mkLogo(SponsorshipType.PaidContent) | ||
val logo = mkLogo(SponsorshipType.PaidContent, None) | ||
logo.label shouldBe "Paid for by" | ||
} | ||
|
||
it should "generate the correct label for foundation-funded content" in { | ||
val logo = mkLogo(SponsorshipType.Foundation, webTitle = "Some title") | ||
val logo = mkLogo(SponsorshipType.Foundation, None, webTitle = "Some title") | ||
logo.label shouldBe "Some title is supported by" | ||
} | ||
|
||
it should "generate the correct label for the special inequality foundation-funded section" in { | ||
val logo = mkLogo(SponsorshipType.Foundation, webTitle = "Inequality") | ||
val logo = mkLogo(SponsorshipType.Foundation, None, webTitle = "Inequality") | ||
logo.label shouldBe "The Inequality Project is supported by" | ||
} | ||
|
||
it should "generate the correct label for the special America's unequal future foundation-funded section" in { | ||
val logo = mkLogo(SponsorshipType.Foundation, webTitle = "Inequality and Opportunity in America") | ||
val logo = mkLogo(SponsorshipType.Foundation, None, webTitle = "Inequality and Opportunity in America") | ||
logo.label shouldBe "This series is supported by" | ||
} | ||
} |