Skip to content

Commit

Permalink
chore: screen amends (#311)
Browse files Browse the repository at this point in the history
* chore: screen amends

* chore: fix bad test check
  • Loading branch information
ReedSoftware authored Nov 4, 2024
1 parent 0c07995 commit 012cb55
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
3 changes: 3 additions & 0 deletions integration_tests/e2e/screen-a-csip.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ context('Screen a CSIP Referral Journey', () => {
getContinueButton().click()

cy.url().should('include', '/screen/check-answers')
cy.title().should('equal', 'Check your answers before recording the screening outcome - Screen CSIP referral - DPS')
cy.findByText(/no action neededmodified/i).should('be.visible')
getCyaSubmitButton().click()

cy.url().should('include', '/screen/confirmation')
cy.title().should('equal', 'CSIP screening outcome recorded - DPS')
checkAxeAccessibility()

// Prevent double submissions after journey is complete
Expand All @@ -69,6 +71,7 @@ context('Screen a CSIP Referral Journey', () => {

cy.url().should('include', '/screen')
getNfaRadio().should('be.checked')
cy.title().should('equal', 'Error: Screen CSIP referral - DPS')
})

it('should prepopulate textbox after an invalid input', () => {
Expand Down
1 change: 1 addition & 0 deletions server/routes/journeys/screen/check-answers/tests.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ context('test /screen/check-answers', () => {
checkAxeAccessibility()

cy.url().should('to.match', /\/check-answers$/)
cy.title().should('equal', 'Check your answers before recording the screening outcome - Screen CSIP referral - DPS')
cy.findByRole('heading', { name: /Check your answers before recording the screening outcome/ }).should('be.visible')

cy.contains('dt', 'Screening outcome').next().should('include.text', `No further action`)
Expand Down
2 changes: 1 addition & 1 deletion server/routes/journeys/screen/check-answers/view.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{% extends "partials/layout.njk" %}

{% set pageTitle = "Check answers - Screen CSIP referral" %}
{% set pageTitle = "Check your answers before recording the screening outcome - Screen CSIP referral" %}

{% block innerContent %}
<span class="govuk-caption-l">Screen CSIP referral</span>
Expand Down
1 change: 1 addition & 0 deletions server/routes/journeys/screen/confirmation/tests.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ context('test /screen/confirmation', () => {

setupData('No further action')
cy.visit(PAGE_URL)
cy.title().should('equal', 'CSIP screening outcome recorded - DPS')

checkAxeAccessibility()
validatePageContents()
Expand Down
2 changes: 1 addition & 1 deletion server/routes/journeys/screen/confirmation/view.njk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% extends "partials/layout.njk" %}

{% set pageTitle = "Confirmation - Screen CSIP referral" %}
{% set pageTitle = "CSIP screening outcome recorded" %}

{% block innerContent %}
{{ govukPanel({
Expand Down
7 changes: 5 additions & 2 deletions server/routes/journeys/update-decision/next-steps/tests.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { v4 as uuidV4 } from 'uuid'
import { checkAxeAccessibility } from '../../../../../integration_tests/support/accessibilityViolations'
import { injectJourneyDataAndReload } from '../../../../../integration_tests/utils/e2eTestUtils'
import { generateSaveTimestamp } from '../../../../utils/appendFieldUtils'

context('test /update-decision/next-steps', () => {
const uuid = uuidV4()
Expand Down Expand Up @@ -44,12 +45,14 @@ context('test /update-decision/next-steps', () => {
csipRecord: {
referral: {
decisionAndActions: {
nextSteps: 'a'.repeat(3001),
nextSteps: 'a'.repeat(3000),
},
},
},
})
cy.contains('You have 944 characters remaining').should('be.visible')
cy.findAllByText(`You have ${1000 - generateSaveTimestamp('John Smith').length} characters remaining`).should(
'be.visible',
)
cy.get('.govuk-inset-text').should('be.visible')
})

Expand Down

0 comments on commit 012cb55

Please sign in to comment.