From ea10e7df43d27d8fdd8d9bf5e0ce8a201cb3eab2 Mon Sep 17 00:00:00 2001 From: George Goodall Date: Tue, 13 Feb 2024 12:01:10 +0000 Subject: [PATCH 1/3] change upload a new version button link --- src/views/errors.html | 2 +- test/acceptance/upload_data.test.js | 18 ++++++++++++++++++ test/mock-api/index.js | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/views/errors.html b/src/views/errors.html index 7e6abc2c..48afcea2 100644 --- a/src/views/errors.html +++ b/src/views/errors.html @@ -70,7 +70,7 @@

{{ govukButton({ text: "Upload a new version", - href: "/upload" + href: "/upload-method" }) }}
diff --git a/test/acceptance/upload_data.test.js b/test/acceptance/upload_data.test.js index db49f8b6..a0da9b9a 100644 --- a/test/acceptance/upload_data.test.js +++ b/test/acceptance/upload_data.test.js @@ -135,3 +135,21 @@ test('Enter form information and specify a URL without errors', async ({ page }) await page.waitForURL('**/confirmation') }) + +test('test', async ({ page }) => { + await page.goto('/') + await page.getByRole('button', { name: 'Start now' }).click(); + + await page.getByLabel('Conservation area dataset').check(); + await page.getByRole('button', { name: 'Continue' }).click(); + + await page.getByLabel('URL').check(); + await page.getByRole('button', { name: 'Continue' }).click(); + + await page.getByLabel('URL').click(); + await page.getByLabel('URL').fill('https://example.com/conservation-area-errors.csv'); + await page.getByRole('button', { name: 'Continue' }).click(); + + await page.getByRole('button', { name: 'Upload a new version' }).click(); + await page.waitForURL('**/upload-method') +}); diff --git a/test/mock-api/index.js b/test/mock-api/index.js index cebef080..d661af5c 100644 --- a/test/mock-api/index.js +++ b/test/mock-api/index.js @@ -26,7 +26,7 @@ app.post(config.api.validationEndpoint, (req, res) => { const _toSend = { ...APIResponse } - if (filename !== 'conservation-area-errors.csv') { + if (filename !== 'conservation-area-errors.csv' && filename !== 'unassigned') { _toSend['issue-log'] = [] _toSend['column-field-log'] = [] } From a09cc02ffa90e20d30e74822a360c229d5ca87d8 Mon Sep 17 00:00:00 2001 From: George Goodall Date: Tue, 13 Feb 2024 12:01:31 +0000 Subject: [PATCH 2/3] linting --- test/acceptance/upload_data.test.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/acceptance/upload_data.test.js b/test/acceptance/upload_data.test.js index a0da9b9a..14edfaf4 100644 --- a/test/acceptance/upload_data.test.js +++ b/test/acceptance/upload_data.test.js @@ -138,18 +138,18 @@ test('Enter form information and specify a URL without errors', async ({ page }) test('test', async ({ page }) => { await page.goto('/') - await page.getByRole('button', { name: 'Start now' }).click(); + await page.getByRole('button', { name: 'Start now' }).click() - await page.getByLabel('Conservation area dataset').check(); - await page.getByRole('button', { name: 'Continue' }).click(); + await page.getByLabel('Conservation area dataset').check() + await page.getByRole('button', { name: 'Continue' }).click() - await page.getByLabel('URL').check(); - await page.getByRole('button', { name: 'Continue' }).click(); + await page.getByLabel('URL').check() + await page.getByRole('button', { name: 'Continue' }).click() - await page.getByLabel('URL').click(); - await page.getByLabel('URL').fill('https://example.com/conservation-area-errors.csv'); - await page.getByRole('button', { name: 'Continue' }).click(); + await page.getByLabel('URL').click() + await page.getByLabel('URL').fill('https://example.com/conservation-area-errors.csv') + await page.getByRole('button', { name: 'Continue' }).click() - await page.getByRole('button', { name: 'Upload a new version' }).click(); + await page.getByRole('button', { name: 'Upload a new version' }).click() await page.waitForURL('**/upload-method') -}); +}) From 65c5706f1d4ef73a9d70b82a9ee6557287b556d1 Mon Sep 17 00:00:00 2001 From: George Goodall Date: Tue, 13 Feb 2024 12:46:56 +0000 Subject: [PATCH 3/3] fix test --- test/acceptance/upload_data.test.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/acceptance/upload_data.test.js b/test/acceptance/upload_data.test.js index 14edfaf4..20bf56a5 100644 --- a/test/acceptance/upload_data.test.js +++ b/test/acceptance/upload_data.test.js @@ -64,6 +64,10 @@ test('Enter form information and upload a file with errors and without errors', await page.getByRole('button', { name: 'Upload a new version' }).click() + await page.waitForURL('**/upload-method') + await page.getByLabel('File Upload').check() + await page.getByRole('button', { name: 'Continue' }).click() + await page.waitForURL('**/upload') fileChooserPromise = page.waitForEvent('filechooser')