Skip to content

Commit

Permalink
Merge pull request #36 from danPudwellOpencast/optional_hmrc_branding
Browse files Browse the repository at this point in the history
added flag and tests for including hmrc branding
  • Loading branch information
Rory Powis committed Feb 5, 2016
2 parents 6a8ee34 + 349b623 commit 87ba87b
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*@
@(betaBanner: Html, includeGridWrapper: Boolean, serviceInfoContent: Option[Html])
@(betaBanner: Html, includeGridWrapper: Boolean, serviceInfoContent: Option[Html], includeHMRCBranding: Boolean = true)

<div class="service-info @if( includeGridWrapper ){ grid-wrapper}">
@betaBanner
<div class="logo">
<span class="organisation-logo organisation-logo-medium">HM Revenue &amp; Customs</span>
</div>
@if(includeHMRCBranding) {
<div class="logo">
<span class="organisation-logo organisation-logo-medium">HM Revenue &amp; Customs</span>
</div>
}
@serviceInfoContent
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright 2016 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package uk.gov.hmrc.play.views.layouts

import org.scalatest.{Matchers, WordSpec}
import play.twirl.api.Html
import uk.gov.hmrc.play.views.html.layouts.serviceInfo
import play.api.test.Helpers._

class ServiceInfoSpec extends WordSpec with Matchers {

"The serviceInfo" should {
"include hmrc branding when not specified" in {
val content = contentAsString(serviceInfo(Html("label"), true, None))
content should include("<div class=\"logo\">")
}

"include hmrc branding when specified" in {
val content = contentAsString(serviceInfo(Html("label"), true, None, true))
content should include("<div class=\"logo\">")
}

"not include hmrc branding when specified" in {
val content = contentAsString(serviceInfo(Html("label"), true, None, false))
content should not include("<div class=\"logo\">")
}
}
}

0 comments on commit 87ba87b

Please sign in to comment.