Skip to content

Commit

Permalink
Export projects - update functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgain committed Nov 7, 2024
1 parent 70425c7 commit f28fb1b
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 7 deletions.
12 changes: 12 additions & 0 deletions test/functional/cypress/fakers/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,18 @@ export const EXPORTER_EXPERIENCE = [
order: 40,
name: 'An exporter that DBT are helping maintain and grow their exports',
},
{
id: 'd23012c5-c1a6-459d-9e05-b3d1b8539025',
order: 1040,
disabled_on: '2018-06-20T10:19:43Z',
name: 'Is an exporter but exports currently account for less than 10% of its overall turnover',
},
{
id: '9390cc45-6ebb-4005-866c-c87fd6d6dec0',
order: 1080,
disabled_on: '2018-06-20T10:19:43Z',
name: 'Is an exporter but has only won export orders in three countries or fewer',
},
]

export const HEADQUARTER_TYPE = [
Expand Down
24 changes: 17 additions & 7 deletions test/functional/cypress/specs/export-pipeline/edit-export-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const {
assertTypeaheadValues,
assertFieldDateShort,
assertPayload,
assertFieldRadiosStrict,
assertTypeaheadOptionSelected,
} = require('../../support/assertions')
const {
Expand Down Expand Up @@ -72,6 +73,11 @@ describe('Export pipeline edit', () => {
const exportItem = exportFaker({
sector: sectors[0],
destination_country: countries[0],
exporter_experience: {
id: '8937c359-157e-41dd-8520-679383847ea0',
order: 20,
name: 'Exported in the last 12 months, but has not won an export order by having an export plan',
},
})
const editPageUrl = urls.exportPipeline.edit(exportItem.id)

Expand Down Expand Up @@ -200,13 +206,17 @@ describe('Export pipeline edit', () => {
'[data-test="field-contacts"]',
exportItem.contacts.map((t) => t.name)
)
cy.get('[data-test="field-exporter_experience"]').then((element) => {
assertFieldRadios({
element,
label: 'Exporter experience (optional)',
optionsCount: 5,
value: exportItem.exporter_experience.name,
})
assertFieldRadiosStrict({
inputName: 'exporter_experience',
legend: 'Exporter experience (optional)',
options: [
'Never exported',
'Exported before, but no exports in the last 12 months',
'Exported in the last 12 months, but has not won an export order by having an export plan',
'An exporter with a new export win, but has not exported to this country within the last 3 years',
'An exporter that DBT are helping maintain and grow their exports',
],
selectedIndex: 2,
})
cy.get('[data-test="field-notes"]').then((element) => {
assertFieldTextarea({
Expand Down
12 changes: 12 additions & 0 deletions test/sandbox/fixtures/v4/export/export-experience.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,17 @@
"id": "02a063e3-dab8-40ca-92d3-8e9c2d9f812d",
"order": 40,
"name": "An exporter that DBT are helping maintain and grow their exports"
},
{
"id": "d23012c5-c1a6-459d-9e05-b3d1b8539025",
"order": 1040,
"disabled_on": "2018-06-20T10:19:43Z",
"name": "Is an exporter but exports currently account for less than 10% of its overall turnover"
},
{
"id": "9390cc45-6ebb-4005-866c-c87fd6d6dec0",
"order": 1080,
"disabled_on": "2018-06-20T10:19:43Z",
"name": "Is an exporter but has only won export orders in three countries or fewer"
}
]

0 comments on commit f28fb1b

Please sign in to comment.