From 8cfb1b0a47947faf858098c70ee7e036b95f9e58 Mon Sep 17 00:00:00 2001 From: Alan Cruikshanks Date: Thu, 10 Oct 2024 11:49:50 +0100 Subject: [PATCH] Fix QA issues in new Monitoring stations page (#1395) https://eaflood.atlassian.net/browse/WATER-4679 We are working on [migrating the monitoring station page](https://github.com/DEFRA/water-abstraction-system/pull/1340) from the legacy UI to this repo. Our fantastic QA team have spotted some issues with the first iteration that this change addresses. - The `< Back` link was supposed to be `< Go back to search` - When a monitoring station (gauging station) is linked to a licence, the link to the licence is broken This change fixes those issues. --- .../view-monitoring-stations.presenter.js | 2 +- app/views/monitoring-stations/view.njk | 2 +- .../view-monitoring-stations.presenter.test.js | 6 +++--- test/services/monitoring-stations/view.service.test.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/presenters/monitoring-stations/view-monitoring-stations.presenter.js b/app/presenters/monitoring-stations/view-monitoring-stations.presenter.js index eb5d811a1b..2fe26dad32 100644 --- a/app/presenters/monitoring-stations/view-monitoring-stations.presenter.js +++ b/app/presenters/monitoring-stations/view-monitoring-stations.presenter.js @@ -119,7 +119,7 @@ function _groupLicences (licences) { if (!grouped[id]) { grouped[id] = { - licenceId: id, + id, licenceRef, linkages: [] } diff --git a/app/views/monitoring-stations/view.njk b/app/views/monitoring-stations/view.njk index 3eaa23db54..70e7898827 100644 --- a/app/views/monitoring-stations/view.njk +++ b/app/views/monitoring-stations/view.njk @@ -14,7 +14,7 @@ {# Back link #} {{ govukBackLink({ - text: 'Back', + text: 'Go back to search', href: "/licences" }) }} diff --git a/test/presenters/monitoring-stations/view-monitoring-stations.presenter.test.js b/test/presenters/monitoring-stations/view-monitoring-stations.presenter.test.js index 5408512522..fe84b27a9c 100644 --- a/test/presenters/monitoring-stations/view-monitoring-stations.presenter.test.js +++ b/test/presenters/monitoring-stations/view-monitoring-stations.presenter.test.js @@ -34,7 +34,7 @@ describe('View Monitoring Stations presenter', () => { stationReference: null, licences: [ { - licenceId: '3cd1481c-e96a-45fc-8f2b-1849564b95a5', + id: '3cd1481c-e96a-45fc-8f2b-1849564b95a5', licenceRef: 'AT/TEST', linkages: [ { @@ -214,7 +214,7 @@ describe('View Monitoring Stations presenter', () => { stationReference: null, licences: [ { - licenceId: '3cd1481c-e96a-45fc-8f2b-1849564b95a5', + id: '3cd1481c-e96a-45fc-8f2b-1849564b95a5', licenceRef: 'AT/TEST', linkages: [{ abstractionPeriod: '1 April to 31 August', @@ -240,7 +240,7 @@ describe('View Monitoring Stations presenter', () => { }] }, { - licenceId: 'fb46704b-0e8c-488e-9b58-faf87b6d9a01', + id: 'fb46704b-0e8c-488e-9b58-faf87b6d9a01', licenceRef: 'AT/TEST/2', linkages: [{ abstractionPeriod: '1 February to 22 July', diff --git a/test/services/monitoring-stations/view.service.test.js b/test/services/monitoring-stations/view.service.test.js index 1d4d05a442..a61e884903 100644 --- a/test/services/monitoring-stations/view.service.test.js +++ b/test/services/monitoring-stations/view.service.test.js @@ -45,7 +45,7 @@ describe('View service', () => { stationReference: null, licences: [ { - licenceId: '3cd1481c-e96a-45fc-8f2b-1849564b95a5', + id: '3cd1481c-e96a-45fc-8f2b-1849564b95a5', licenceRef: 'AT/TEST', linkages: [ {