From 52f466822a5161b602bef97b22a765dc691a41e3 Mon Sep 17 00:00:00 2001 From: Michael Steinacher Date: Thu, 23 Apr 2026 07:33:47 +0100 Subject: [PATCH 1/2] FCRM-6800 Add risk of flooding bp to results when no data found https://eaflood.atlassian.net/browse/FCRM-6800 When no data is found in a polygon, the bulletpoint at the top of the page should show risk from both tidal and fluvial. From 4f3c34be3b9f4876b76d1a148c7a225c834a32b3 Mon Sep 17 00:00:00 2001 From: Michael Steinacher Date: Thu, 23 Apr 2026 09:39:28 +0100 Subject: [PATCH 2/2] Added logic for new no data climate change bullet point. --- server/routes/__tests__/results.spec.js | 35 +++++++++++++++++++++++++ server/views/results.html | 3 ++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/server/routes/__tests__/results.spec.js b/server/routes/__tests__/results.spec.js index 6c380227..22b44495 100644 --- a/server/routes/__tests__/results.spec.js +++ b/server/routes/__tests__/results.spec.js @@ -318,6 +318,38 @@ describe('Results page', () => { expect(pageContent.siteDrawnSize).toEqual(false) }) + it('should rivers and sea climate change bullet point when no data climate change zone only', async () => { + getPsoContactsByPolygon.mockResolvedValue({ + isEngland: true, + EmailAddress: 'emdenquiries@environment-agency.gov.uk', + AreaName: 'East Midlands', + useAutomatedService: true, + LocalAuthorities: 'Derbyshire Dales' + }) + getFloodDataByPolygon.mockResolvedValue({ + floodzone_2: false, + floodzone_3: false, + floodZone: '1', + floodZoneLevel: 'low', + floodZoneClimateChange: true, + floodZoneClimateChangeNoData: true, + surfaceWater: { + riskBandId: -1, + riskBand: false, + riskBandPercent: null, + riskBandOdds: null + }, + isRiskAdminArea: false, + hasSeaSource: false, + hasRiversSource: false, + floodSource: 'Unavailable' + }) + getAreaInHectaresSpy.mockReturnValue(0) + const response = await submitGetRequest({ url: `${url}?${getUniquePolygonQuery()}` }) + const pageContent = getElementByIdAndFormat(response.payload) + expect(pageContent.riversAndSeaCCNoDataBulletPoint).toEqual(riversAndSeaCCNoDataBulletPointText) + }) + it('should show RS title and bullet point, zone 1 relevant text (no FRA) when admin console updated area', async () => { getPsoContactsByPolygon.mockResolvedValue({ isEngland: true, @@ -728,6 +760,7 @@ const riversBulletPointText = 'rivers (fluvial)' const seaBulletPointText = 'the sea (tidal)' const riversAndSeaBulletPointText = 'rivers and the sea (fluvial and tidal)' const swBulletPointText = 'surface water' +const riversAndSeaCCNoDataBulletPointText = 'rivers and the sea (fluvial or tidal) due to climate change' const fz1DataUnlikelyText = 'Your site is in flood zone 1, so it\'s unlikely we\'ll have any flood risk data for it. You can place an order and we\'ll email you if none is available.' const rsSummaryTitleText = 'Rivers and the sea' const orderP4ButtonText = 'Order flood risk data' @@ -759,6 +792,7 @@ const getElementByIdAndFormat = (payload) => { const riversAndSeaBulletPoint = document.getElementById('riversAndSeaBulletPoint') ? removeHtmlGaps(document.getElementById('riversAndSeaBulletPoint').textContent) : false const riversBulletPoint = document.getElementById('riversBulletPoint') ? removeHtmlGaps(document.getElementById('riversBulletPoint').textContent) : false const seaBulletPoint = document.getElementById('seaBulletPoint') ? removeHtmlGaps(document.getElementById('seaBulletPoint').textContent) : false + const riversAndSeaCCNoDataBulletPoint = document.getElementById('riversAndSeaNoDataBulletPoint') ? removeHtmlGaps(document.getElementById('riversAndSeaNoDataBulletPoint').textContent) : false const fz1DataUnlikely = document.getElementById('fz1DataUnlikely') ? removeHtmlGaps(document.getElementById('fz1DataUnlikely').textContent) : false const rsSummaryTitle = removeHtmlGaps(document.getElementById('rsSummaryTitle').textContent) const orderP4Button = document.getElementById('orderP4Button') ? removeHtmlGaps(document.getElementById('orderP4Button').textContent) : false @@ -790,6 +824,7 @@ const getElementByIdAndFormat = (payload) => { riversBulletPoint, seaBulletPoint, swBulletPoint, + riversAndSeaCCNoDataBulletPoint, fz1DataUnlikely, rsSummaryTitle, orderP4Button, diff --git a/server/views/results.html b/server/views/results.html index 91910307..fc853d28 100644 --- a/server/views/results.html +++ b/server/views/results.html @@ -16,7 +16,8 @@

{{ pageTitle }}

{% endif %}