Skip to content

Commit

Permalink
Merge pull request #57 from digital-land/uploadNewVersionBug
Browse files Browse the repository at this point in the history
Upload new version bug
  • Loading branch information
GeorgeGoodall authored Feb 13, 2024
2 parents daf3703 + 65c5706 commit 7834d0d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/views/errors.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ <h2 class="govuk-heading-m">
<div class="govuk-grid-column-two-thirds">
{{ govukButton({
text: "Upload a new version",
href: "/upload"
href: "/upload-method"
}) }}

</div>
Expand Down
22 changes: 22 additions & 0 deletions test/acceptance/upload_data.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -135,3 +139,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')
})
2 changes: 1 addition & 1 deletion test/mock-api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'] = []
}
Expand Down

0 comments on commit 7834d0d

Please sign in to comment.