Skip to content

Commit

Permalink
MIB-153_V3: Add email to declaration confirmation
Browse files Browse the repository at this point in the history
  • Loading branch information
PasGat committed Nov 23, 2020
1 parent 1ebdf1e commit b85677c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h1 id="panelTitleId" class="govuk-panel__title">Declaration complete</h1>

<h2 id="declarationDateId" class="govuk-heading-m" id="main-message">@messages("declarationConfirmation.date")</h2>
<p id="declarationDateFormattedId" class="govuk-body">@declaration.dateOfDeclaration.formattedDate</p>
<!-- <p class="govuk-body">@messages("declarationConfirmation.email", declaration)</p>-->
<p id="declarationEmailId" class="govuk-body">@messages("declarationConfirmation.email", declaration.email.email)</p>
<p class="govuk-body">
<a id="printDeclarationId" class="govuk-link" href="javascript:window.print();">Print or save a copy of this page
<link id="printDeclarationLinkId" class="govuk-link" href="/merchandise-in-baggage/assets/stylesheets/application.css" media="all" rel="stylesheet" type="text/css">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,19 @@ class DeclarationConfirmationPageSpec extends BasePageSpec[DeclarationConfirmati
"make declaration" in {
val id = DeclarationId("456")
val declarationJourney = completedDeclarationJourney.copy(declarationType = DeclarationType.Export)
val declarationCompleted = declarationJourney.declarationIfRequiredAndComplete.get
givenADeclarationJourney(declarationJourney.copy(declarationId = Some(id)))
givenPersistedDeclarationIsFound(wireMockServer, declarationJourney.declarationIfRequiredAndComplete.get, id)
givenPersistedDeclarationIsFound(wireMockServer, declarationCompleted, id)
open(path)

page.mustRenderBasicContentWithoutHeader(path, title)
hasConfirmationPanelWithContents
hasDateOfDeclaration
hasEmailAddress(declarationCompleted)
hasPrintPageContentInPdf
hasWhaToDoNext
hasGoodDetails(completedDeclarationJourney.declarationIfRequiredAndComplete.get)
hasPersonDetails(completedDeclarationJourney.declarationIfRequiredAndComplete.get)
hasGoodDetails(declarationCompleted)
hasPersonDetails(declarationCompleted)
hasMakeAnotherDeclarationLink
}
}
Expand All @@ -66,6 +68,9 @@ class DeclarationConfirmationPageSpec extends BasePageSpec[DeclarationConfirmati
textOfElementWithId("declarationDateFormattedId") must include(LocalDateTime.now.format(Declaration.formatter))
}

def hasEmailAddress(declaration: Declaration): Assertion =
textOfElementWithId("declarationEmailId") mustBe s"We have sent you a confirmation email to ${declaration.email.email}."

def hasPrintPageContentInPdf: Assertion = {
attrOfElementWithId("printDeclarationId", "href") mustBe "javascript:window.print();"
textOfElementWithId("printDeclarationId") mustBe "Print or save a copy of this page"
Expand Down

0 comments on commit b85677c

Please sign in to comment.