From b746272d4a71ef6d4892cf653c376411822f540c Mon Sep 17 00:00:00 2001 From: George Goodall Date: Fri, 10 Nov 2023 10:59:30 +0000 Subject: [PATCH 01/16] added test for the data-subject page --- test/acceptance/validation_errors.test.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/acceptance/validation_errors.test.js diff --git a/test/acceptance/validation_errors.test.js b/test/acceptance/validation_errors.test.js new file mode 100644 index 00000000..e5c2d4d9 --- /dev/null +++ b/test/acceptance/validation_errors.test.js @@ -0,0 +1,20 @@ +import { test, expect } from '@playwright/test' + +test('when the user clicks continue on the dataset page without entering a data subject, the page correctly indicates there\'s an error', async ({ page }) => { + await page.goto('/') + await page.getByRole('button', { name: 'Start now' }).click() + await page.getByRole('button', { name: 'Continue' }).click() + + const errorLink = await page.getByRole('link', { name: 'Please select a data subject' }) + const fieldError = await page.getByText('Error: Please select a data subject') + const errorSummary = await page.getByText('There is a problem') + + expect(await errorSummary.isVisible(), 'Page should show the error summary').toBeTruthy() + expect(await errorLink.isVisible(), 'Page should the error message that is a link to the problem field').toBeTruthy() + expect(await fieldError.isVisible(), 'Page should show the error message next to the problem field').toBeTruthy() + await errorLink.click() + const problemFieldIsFocused = await page.$eval('input#data-subject.govuk-radios__input', (el) => el === document.activeElement) + expect(problemFieldIsFocused, 'The focus should be on the problem field').toBeTruthy() + + expect(await page.title(), 'Page title should indicate there\'s an error').toMatch(/Error: .*/) +}) From c6514676fb9d80e7104eda78ab906519ea9cea4f Mon Sep 17 00:00:00 2001 From: George Goodall Date: Fri, 10 Nov 2023 10:59:42 +0000 Subject: [PATCH 02/16] added input validation for the data subject page --- src/views/data-subject.html | 38 ++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/src/views/data-subject.html b/src/views/data-subject.html index e762c8b8..2fa83212 100644 --- a/src/views/data-subject.html +++ b/src/views/data-subject.html @@ -3,9 +3,31 @@ {% from 'govuk/components/back-link/macro.njk' import govukBackLink %} {% from 'govuk/components/button/macro.njk' import govukButton %} {% from 'govuk/components/radios/macro.njk' import govukRadios %} +{% from 'govuk/components/radios/macro.njk' import govukRadios %} +{% from 'govuk/components/error-message/macro.njk' import govukErrorMessage %} +{% from 'govuk/components/error-summary/macro.njk' import govukErrorSummary %} + + {% set pageName = 'Data subject' %} +{% set errorMessage = 'Please select a data subject' %} + +{% if 'data-subject' in errors %} + {% set dataSubjectError = true %} +{% endif %} + +{% set pageTitle = 'Enter a datasubject'%} + +{% block pageTitle %} + {% if dataSubjectError %} + Error: {{super()}} + {% else %} + {{super()}} + {% endif %} +{% endblock %} + + {% block beforeContent %} {{ govukBackLink({ text: "Back", @@ -16,6 +38,17 @@ {% block content %}
+ {% if dataSubjectError %} + {{ govukErrorSummary({ + titleText: "There is a problem", + errorList: [ + { + text: errorMessage, + href: "#data-subject" + } + ] + }) }} + {% endif %}
{{ govukRadios({ @@ -46,7 +79,10 @@ text: "Tree preservation order" } ], - value: data.check.dataSubject + value: data.check.dataSubject, + errorMessage: { + text: errorMessage + } if dataSubjectError else undefined }) }} {{ govukButton({ From d408514e1fcc0fb6c1fefc1f6deb31a83bfe91ba Mon Sep 17 00:00:00 2001 From: George Goodall Date: Fri, 10 Nov 2023 11:10:56 +0000 Subject: [PATCH 03/16] added a test for the dataset input page --- test/acceptance/validation_errors.test.js | 28 ++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/test/acceptance/validation_errors.test.js b/test/acceptance/validation_errors.test.js index e5c2d4d9..53ebd748 100644 --- a/test/acceptance/validation_errors.test.js +++ b/test/acceptance/validation_errors.test.js @@ -1,6 +1,6 @@ import { test, expect } from '@playwright/test' -test('when the user clicks continue on the dataset page without entering a data subject, the page correctly indicates there\'s an error', async ({ page }) => { +test('when the user clicks continue on the data subject page without entering a data subject, the page correctly indicates there\'s an error', async ({ page }) => { await page.goto('/') await page.getByRole('button', { name: 'Start now' }).click() await page.getByRole('button', { name: 'Continue' }).click() @@ -18,3 +18,29 @@ test('when the user clicks continue on the dataset page without entering a data expect(await page.title(), 'Page title should indicate there\'s an error').toMatch(/Error: .*/) }) + +test('when the user clicks continue on the dataset page without entering a dataset, the page correctly indicates there\'s an error', async ({ page }) => { + await page.goto('/') + // start page + await page.getByRole('button', { name: 'Start now' }).click() + + // data subject page + await page.getByLabel('Conservation area').check() + await page.getByRole('button', { name: 'Continue' }).click() + + // dataset page + await page.getByRole('button', { name: 'Continue' }).click() + + const errorLink = await page.getByRole('link', { name: 'Please select a dataset' }) + const fieldError = await page.getByText('Error: Please select a dataset') + const errorSummary = await page.getByText('There is a problem') + + expect(await errorSummary.isVisible(), 'Page should show the error summary').toBeTruthy() + expect(await errorLink.isVisible(), 'Page should the error message that is a link to the problem field').toBeTruthy() + expect(await fieldError.isVisible(), 'Page should show the error message next to the problem field').toBeTruthy() + await errorLink.click() + const problemFieldIsFocused = await page.$eval('input#data-subject.govuk-radios__input', (el) => el === document.activeElement) + expect(problemFieldIsFocused, 'The focus should be on the problem field').toBeTruthy() + + expect(await page.title(), 'Page title should indicate there\'s an error').toMatch(/Error: .*/) +}) From 3c17a57216698dedb7b01f1f8be9ac42aaf70db7 Mon Sep 17 00:00:00 2001 From: George Goodall Date: Fri, 10 Nov 2023 11:11:12 +0000 Subject: [PATCH 04/16] added lint:fix to the husky precommit --- .husky/pre-commit | 1 + 1 file changed, 1 insertion(+) diff --git a/.husky/pre-commit b/.husky/pre-commit index 251a23e7..cf13ffbe 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,5 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" +npm run lint:fix npm run lint \ No newline at end of file From 6ecee0517e489170751d020d06f52f3a85e7b753 Mon Sep 17 00:00:00 2001 From: George Goodall Date: Fri, 10 Nov 2023 11:22:40 +0000 Subject: [PATCH 05/16] remove double import --- src/views/data-subject.html | 1 - 1 file changed, 1 deletion(-) diff --git a/src/views/data-subject.html b/src/views/data-subject.html index 2fa83212..4947e040 100644 --- a/src/views/data-subject.html +++ b/src/views/data-subject.html @@ -3,7 +3,6 @@ {% from 'govuk/components/back-link/macro.njk' import govukBackLink %} {% from 'govuk/components/button/macro.njk' import govukButton %} {% from 'govuk/components/radios/macro.njk' import govukRadios %} -{% from 'govuk/components/radios/macro.njk' import govukRadios %} {% from 'govuk/components/error-message/macro.njk' import govukErrorMessage %} {% from 'govuk/components/error-summary/macro.njk' import govukErrorSummary %} From c27460c71023151c2f61e980c2b43a53bc891c15 Mon Sep 17 00:00:00 2001 From: George Goodall Date: Fri, 10 Nov 2023 11:23:16 +0000 Subject: [PATCH 06/16] remove unneeded line --- src/views/data-subject.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/views/data-subject.html b/src/views/data-subject.html index 4947e040..4a26f76d 100644 --- a/src/views/data-subject.html +++ b/src/views/data-subject.html @@ -16,8 +16,6 @@ {% set dataSubjectError = true %} {% endif %} -{% set pageTitle = 'Enter a datasubject'%} - {% block pageTitle %} {% if dataSubjectError %} Error: {{super()}} From 924fc205f0fef38c0dc520abec71065577a63926 Mon Sep 17 00:00:00 2001 From: George Goodall Date: Fri, 10 Nov 2023 11:49:19 +0000 Subject: [PATCH 07/16] added input errors to dataset page --- src/views/dataset.html | 77 ++++++++++++++++------- test/acceptance/validation_errors.test.js | 6 +- 2 files changed, 59 insertions(+), 24 deletions(-) diff --git a/src/views/dataset.html b/src/views/dataset.html index f4559f87..3f3c844d 100644 --- a/src/views/dataset.html +++ b/src/views/dataset.html @@ -2,9 +2,26 @@ {% from 'govuk/components/back-link/macro.njk' import govukBackLink %} {% from 'govuk/components/button/macro.njk' import govukButton %} {% from 'govuk/components/radios/macro.njk' import govukRadios %} +{% from 'govuk/components/error-message/macro.njk' import govukErrorMessage %} +{% from 'govuk/components/error-summary/macro.njk' import govukErrorSummary %} {% set pageName = 'Dataset' %} +{% set errorMessage = 'Please select a dataset' %} + + +{% if 'dataset' in errors %} + {% set datasetError = true %} +{% endif %} + +{% block pageTitle %} + {% if datasetError %} + Error: {{super()}} + {% else %} + {{super()}} + {% endif %} +{% endblock %} + {% block beforeContent %} {{ govukBackLink({ text: "Back", @@ -13,28 +30,42 @@ {% endblock %} {% block content %} -
-
- - - {{ govukRadios({ - idPrefix: "dataset", - name: "dataset", - fieldset: { - legend: { - text: pageName, - isPageHeading: true, - classes: "govuk-fieldset__legend--l" - } - }, - items: options.datasetItems, - value: data.check.dataset - }) }} - - {{ govukButton({ - text: "Continue" - }) }} - -
+
+
+ {% if datasetError %} + {{ govukErrorSummary({ + titleText: "There is a problem", + errorList: [ + { + text: errorMessage, + href: "#dataset" + } + ] + }) }} + {% endif %} +
+ + {{ govukRadios({ + idPrefix: "dataset", + name: "dataset", + fieldset: { + legend: { + text: pageName, + isPageHeading: true, + classes: "govuk-fieldset__legend--l" + } + }, + items: options.datasetItems, + value: data.check.dataset, + errorMessage: { + text: errorMessage + } if datasetError else undefined + }) }} + + {{ govukButton({ + text: "Continue" + }) }} +
+
{% endblock %} diff --git a/test/acceptance/validation_errors.test.js b/test/acceptance/validation_errors.test.js index 53ebd748..0854440a 100644 --- a/test/acceptance/validation_errors.test.js +++ b/test/acceptance/validation_errors.test.js @@ -5,6 +5,8 @@ test('when the user clicks continue on the data subject page without entering a await page.getByRole('button', { name: 'Start now' }).click() await page.getByRole('button', { name: 'Continue' }).click() + await page.waitForSelector('input#data-subject.govuk-radios__input') + const errorLink = await page.getByRole('link', { name: 'Please select a data subject' }) const fieldError = await page.getByText('Error: Please select a data subject') const errorSummary = await page.getByText('There is a problem') @@ -31,6 +33,8 @@ test('when the user clicks continue on the dataset page without entering a datas // dataset page await page.getByRole('button', { name: 'Continue' }).click() + await page.waitForSelector('input#dataset.govuk-radios__input') + const errorLink = await page.getByRole('link', { name: 'Please select a dataset' }) const fieldError = await page.getByText('Error: Please select a dataset') const errorSummary = await page.getByText('There is a problem') @@ -39,7 +43,7 @@ test('when the user clicks continue on the dataset page without entering a datas expect(await errorLink.isVisible(), 'Page should the error message that is a link to the problem field').toBeTruthy() expect(await fieldError.isVisible(), 'Page should show the error message next to the problem field').toBeTruthy() await errorLink.click() - const problemFieldIsFocused = await page.$eval('input#data-subject.govuk-radios__input', (el) => el === document.activeElement) + const problemFieldIsFocused = await page.$eval('input#dataset.govuk-radios__input', (el) => el === document.activeElement) expect(problemFieldIsFocused, 'The focus should be on the problem field').toBeTruthy() expect(await page.title(), 'Page title should indicate there\'s an error').toMatch(/Error: .*/) From 9e5209edaa65214f3dd2120cdd99ed8579712f74 Mon Sep 17 00:00:00 2001 From: George Goodall Date: Fri, 10 Nov 2023 13:22:29 +0000 Subject: [PATCH 08/16] added a test for error messages on the file upload page --- test/acceptance/validation_errors.test.js | 32 +++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/test/acceptance/validation_errors.test.js b/test/acceptance/validation_errors.test.js index 0854440a..71d2696b 100644 --- a/test/acceptance/validation_errors.test.js +++ b/test/acceptance/validation_errors.test.js @@ -48,3 +48,35 @@ test('when the user clicks continue on the dataset page without entering a datas expect(await page.title(), 'Page title should indicate there\'s an error').toMatch(/Error: .*/) }) + +test('when the user clicks continue on the file upload page without selecting a file, the page correctly indicates there\'s an error', async ({ page }) => { + await page.goto('/') + // start page + await page.getByRole('button', { name: 'Start now' }).click() + + // data subject page + await page.getByLabel('Conservation area').check() + await page.getByRole('button', { name: 'Continue' }).click() + + // dataset page + await page.getByLabel('Conservation area dataset').check() + await page.getByRole('button', { name: 'Continue' }).click() + + // file upload page + await page.getByRole('button', { name: 'Continue' }).click() + await page.waitForSelector('input#datafile.govuk-file-upload') + + const errorLink = await page.getByRole('link', { name: 'Please select a file' }) + const fieldError = await page.getByText('Error: Please select a file') + const errorSummary = await page.getByText('There is a problem') + + expect(await errorSummary.isVisible(), 'Page should show the error summary').toBeTruthy() + expect(await errorLink.isVisible(), 'Page should the error message that is a link to the problem field').toBeTruthy() + expect(await fieldError.isVisible(), 'Page should show the error message next to the problem field').toBeTruthy() + await errorLink.click() + + const problemFieldIsFocused = await page.$eval('input#datafile.govuk-file-upload', (el) => el === document.activeElement) + expect(problemFieldIsFocused, 'The focus should be on the problem field').toBeTruthy() + + expect(await page.title(), 'Page title should indicate there\'s an error').toMatch(/Error: .*/) +}) From 3ff65061aa272568ee17bdf55006a5d8248bb057 Mon Sep 17 00:00:00 2001 From: George Goodall Date: Fri, 10 Nov 2023 13:59:52 +0000 Subject: [PATCH 09/16] refactor upload controller --- src/controllers/uploadController.js | 46 ++++++++++++++++++----------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/src/controllers/uploadController.js b/src/controllers/uploadController.js index fc00d304..eae46bbd 100644 --- a/src/controllers/uploadController.js +++ b/src/controllers/uploadController.js @@ -18,30 +18,40 @@ class UploadController extends Controller { } async post (req, res, next) { + if (req.file !== undefined) { + try { + const jsonResult = await this.validateFile({ + filePath: req.file.path, + fileName: req.file.originalname, + dataset: req.sessionModel.get('dataset'), + dataSubject: req.sessionModel.get('data-subject'), + organization: 'mockOrg' + }) + req.sessionModel.set('validationResult', jsonResult) + } catch (error) { + console.log(error) + } + } + super.post(req, res, next) + } + + async validateFile ({ filePath, fileName, dataset, dataSubject, organization }) { const formData = new FormData() - formData.append('dataset', req.sessionModel.get('dataset')) - formData.append('collection', req.sessionModel.get('data-subject')) - formData.append('organization', 'mockOrg') + formData.append('dataset', dataset) + formData.append('collection', dataSubject) + formData.append('organization', organization) - const filePath = req.file.path const file = new Blob([await readFile(filePath)], { type: lookup(filePath) }) - formData.append('upload_file', file, req.file.originalname) + formData.append('upload_file', file, fileName) - try { - // post the data to the api - const result = await fetch(apiRoute, { - method: 'POST', - body: formData - }) + // post the data to the api + const result = await fetch(apiRoute, { + method: 'POST', + body: formData + }) - const json = await result.json() - - req.sessionModel.set('validationResult', json) - super.post(req, res, next) - } catch (e) { - res.send(e) - } + return await result.json() } } From e0d975eb52c674316c46c4cdb4e99f2aa57d4d42 Mon Sep 17 00:00:00 2001 From: George Goodall Date: Fri, 10 Nov 2023 14:00:15 +0000 Subject: [PATCH 10/16] added empty file-not-found.html file --- src/views/pages/file-not-found.html | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/views/pages/file-not-found.html diff --git a/src/views/pages/file-not-found.html b/src/views/pages/file-not-found.html new file mode 100644 index 00000000..e69de29b From 0bc33aea86b6f52559c69f5062c75c38cb93e749 Mon Sep 17 00:00:00 2001 From: George Goodall Date: Fri, 10 Nov 2023 14:00:30 +0000 Subject: [PATCH 11/16] set datafile as required in the upload step --- src/routes/form-wizard/steps.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/routes/form-wizard/steps.js b/src/routes/form-wizard/steps.js index 6a066ded..a18cc966 100644 --- a/src/routes/form-wizard/steps.js +++ b/src/routes/form-wizard/steps.js @@ -16,6 +16,7 @@ module.exports = { }, '/upload': { controller: require('../../controllers/uploadController'), + fields: ['datafile'], next: 'errors' }, '/errors': { From 55034a84ef2f2976a6c4fccccedc1703bd89dd9c Mon Sep 17 00:00:00 2001 From: George Goodall Date: Fri, 10 Nov 2023 14:01:56 +0000 Subject: [PATCH 12/16] added error messages to upload.html --- src/views/upload.html | 34 ++++++++++++++++++++++- test/acceptance/validation_errors.test.js | 2 +- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/views/upload.html b/src/views/upload.html index d3465eec..9b596082 100644 --- a/src/views/upload.html +++ b/src/views/upload.html @@ -3,9 +3,27 @@ {% from "govuk/components/back-link/macro.njk" import govukBackLink %} {% from "govuk/components/file-upload/macro.njk" import govukFileUpload %} {% from "govuk/components/button/macro.njk" import govukButton %} +{% from 'govuk/components/error-message/macro.njk' import govukErrorMessage %} +{% from 'govuk/components/error-summary/macro.njk' import govukErrorSummary %} + {% set pageName = 'Upload data' %} +{% set errorMessage = 'Please select a file' %} + + +{% if 'datafile' in errors %} + {% set datasetError = true %} +{% endif %} + +{% block pageTitle %} + {% if datasetError %} + Error: {{super()}} + {% else %} + {{super()}} + {% endif %} +{% endblock %} + {% block beforeContent %} {{ govukBackLink({ text: "Back", @@ -16,6 +34,17 @@ {% block content %}
+ {% if datasetError %} + {{ govukErrorSummary({ + titleText: "There is a problem", + errorList: [ + { + text: errorMessage, + href: "#datafile" + } + ] + }) }} + {% endif %}
{{ govukFileUpload({ @@ -28,7 +57,10 @@ }, hint: { text: "You can upload a CSV, GeoJSON, GML or Geopackage file" - } + }, + errorMessage: { + text: errorMessage + } if datasetError else undefined }) }} {{ govukButton({ text: "Continue" diff --git a/test/acceptance/validation_errors.test.js b/test/acceptance/validation_errors.test.js index 71d2696b..c283ac5a 100644 --- a/test/acceptance/validation_errors.test.js +++ b/test/acceptance/validation_errors.test.js @@ -74,7 +74,7 @@ test('when the user clicks continue on the file upload page without selecting a expect(await errorLink.isVisible(), 'Page should the error message that is a link to the problem field').toBeTruthy() expect(await fieldError.isVisible(), 'Page should show the error message next to the problem field').toBeTruthy() await errorLink.click() - + const problemFieldIsFocused = await page.$eval('input#datafile.govuk-file-upload', (el) => el === document.activeElement) expect(problemFieldIsFocused, 'The focus should be on the problem field').toBeTruthy() From 3444727089fe403252d3a63957e30be14b5e84ff Mon Sep 17 00:00:00 2001 From: George Goodall Date: Fri, 10 Nov 2023 14:16:46 +0000 Subject: [PATCH 13/16] make the validationResult the required field --- src/routes/form-wizard/steps.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/form-wizard/steps.js b/src/routes/form-wizard/steps.js index a18cc966..87a89d0f 100644 --- a/src/routes/form-wizard/steps.js +++ b/src/routes/form-wizard/steps.js @@ -16,7 +16,7 @@ module.exports = { }, '/upload': { controller: require('../../controllers/uploadController'), - fields: ['datafile'], + fields: ['validationResult'], next: 'errors' }, '/errors': { From f9b088443fbc8125a5c5bc42e6f00c5d08ddb443 Mon Sep 17 00:00:00 2001 From: George Goodall Date: Fri, 10 Nov 2023 14:17:15 +0000 Subject: [PATCH 14/16] set the validation result on the body, and rename error to have key validationResult --- src/controllers/uploadController.js | 2 +- src/views/upload.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/uploadController.js b/src/controllers/uploadController.js index eae46bbd..9af2c1a5 100644 --- a/src/controllers/uploadController.js +++ b/src/controllers/uploadController.js @@ -27,7 +27,7 @@ class UploadController extends Controller { dataSubject: req.sessionModel.get('data-subject'), organization: 'mockOrg' }) - req.sessionModel.set('validationResult', jsonResult) + req.body.validationResult = jsonResult } catch (error) { console.log(error) } diff --git a/src/views/upload.html b/src/views/upload.html index 9b596082..8e4e3031 100644 --- a/src/views/upload.html +++ b/src/views/upload.html @@ -12,7 +12,7 @@ {% set errorMessage = 'Please select a file' %} -{% if 'datafile' in errors %} +{% if 'validationResult' in errors %} {% set datasetError = true %} {% endif %} From dc0a954217105e6b88a1cb155c7254478a73c7d9 Mon Sep 17 00:00:00 2001 From: George Goodall Date: Fri, 10 Nov 2023 14:17:49 +0000 Subject: [PATCH 15/16] add newline to pre-commit --- .husky/pre-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index cf13ffbe..6f5cf54d 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -2,4 +2,4 @@ . "$(dirname -- "$0")/_/husky.sh" npm run lint:fix -npm run lint \ No newline at end of file +npm run lint From 2db13020eb794d5d942d0714ca18fd6825b30d24 Mon Sep 17 00:00:00 2001 From: George Goodall Date: Fri, 10 Nov 2023 14:21:14 +0000 Subject: [PATCH 16/16] fixed test --- test/unit/uploadController.test.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/unit/uploadController.test.js b/test/unit/uploadController.test.js index 9222a783..9aef7d6d 100644 --- a/test/unit/uploadController.test.js +++ b/test/unit/uploadController.test.js @@ -24,7 +24,8 @@ describe('UploadController', () => { sessionModel: { get: () => 'test', set: vi.fn() - } + }, + body: {} } const res = { send: vi.fn(), @@ -34,6 +35,6 @@ describe('UploadController', () => { await uploadController.post(req, res, next) - expect(req.sessionModel.set).toHaveBeenCalledWith('validationResult', mockApiValue) + expect(req.body.validationResult).toEqual(mockApiValue) }) })