Skip to content

Commit

Permalink
MAN-382 fix deeplink on appointments page (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
achimber-moj authored Feb 7, 2025
1 parent afb9afd commit 01e50a5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 9 additions & 0 deletions integration_tests/e2e/appointments.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ context('Appointment', () => {
it('Appointments page with upcoming and past appointments is rendered', () => {
cy.visit('/case/X000001/appointments')
const page = Page.verifyOnPage(AppointmentsPage)
const url = 'https://ndelius-dummy-url/NDelius-war/delius/JSP/deeplink.xhtml?component=ContactList&CRN=X000001'

page.headerCrn().should('contain.text', 'X000001')
page.headerName().should('contain.text', 'Eula Schmeler')
page.assertRiskTags()
Expand All @@ -43,5 +45,12 @@ context('Appointment', () => {
page.pastAppointmentDate(2).should('contain.text', '21 March 2024')
page.pastAppointmentTime(2).should('contain.text', '10:15am to 10:30am')
page.pastAppointmentType(2).should('contain.text', 'Phone call')

page.assertAnchorElementAtIndexWithin('[class="govuk-table__row"]', 1, 1, url)
page.assertAnchorElementAtIndexWithin('[class="govuk-table__row"]', 2, 1, url)
page.assertAnchorElementAtIndexWithin('[class="govuk-table__row"]', 4, 1, url)
page.assertAnchorElementAtIndexWithin('[class="govuk-table__row"]', 5, 1, url)
page.assertAnchorElementAtIndexWithin('[class="govuk-table__row"]', 6, 1, url)
page.assertAnchorElementAtIndexWithin('[class="govuk-table__row"]', 7, 1, url)
})
})
6 changes: 3 additions & 3 deletions server/views/pages/appointments.njk
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
]
}) }}
{% else %}
<a class="govuk-link govuk-link--no-visited-state" target="_blank" href="{{ deliusDeepLinkUrl('ContactList', offenderId) }}">Manage on NDelius</a>
<a class="govuk-link govuk-link--no-visited-state" target="_blank" href="{{ deliusDeepLinkUrl('ContactList', crn) }}">Manage on NDelius</a>
{% endif %}
{% endset %}

Expand Down Expand Up @@ -87,7 +87,7 @@
]
}) }}
{% else %}
<a class="govuk-link govuk-link--no-visited-state" target="_blank" href="{{ deliusDeepLinkUrl('ContactList', offenderId) }}">Manage on NDelius</a>
<a class="govuk-link govuk-link--no-visited-state" target="_blank" href="{{ deliusDeepLinkUrl('ContactList', crn) }}">Manage on NDelius</a>
{% endif %}
{% endset %}

Expand Down Expand Up @@ -147,7 +147,7 @@
<input type="hidden" name="_csrf" value="{{ csrfToken }}">
</form>
{% else %}
<a href="{{ deliusDeepLinkUrl('ContactList', offenderId) }}" target="_blank" class="govuk-button">Arrange an appointment</a>
<a href="{{ deliusDeepLinkUrl('ContactList', crn) }}" target="_blank" class="govuk-button">Arrange an appointment</a>
{% endif %}
</div>
{% endblock %}
Expand Down

0 comments on commit 01e50a5

Please sign in to comment.