This repository has been archived by the owner on Nov 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from uktrade/feature/title-tag
Feature/title tag
- Loading branch information
Showing
19 changed files
with
221 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,5 +94,23 @@ | |
"risk_severity_status_disagree_reason": "", | ||
"slug": "supply-chain-6" | ||
} | ||
} | ||
}, | ||
{ | ||
"model": "supply_chains.supplychain", | ||
"pk": "3dcb2693-5ce7-420b-bfcf-ee70be2921fc", | ||
"fields": { | ||
"name": "Supply Chain 7", | ||
"last_submission_date": "2021-04-01", | ||
"gov_department": "15fb0d63-2ee6-4652-8acd-222bd2718703", | ||
"contact_name": "nobody", | ||
"contact_email": "[email protected]", | ||
"vulnerability_status": "low", | ||
"vulnerability_status_disagree_reason": "", | ||
"risk_severity_status": "low", | ||
"risk_severity_status_disagree_reason": "", | ||
"slug": "supply-chain-7", | ||
"is_archived": false, | ||
"archived_date": null | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
import supplyChains from '../fixtures/supplyChains.json'; | ||
import strategicActions from '../fixtures/strategicActions.json'; | ||
import strategicActionUpdates from '../fixtures/strategicActionUpdates.json'; | ||
|
||
const supplyChain = supplyChains.find((supplyChain) => supplyChain.fields.slug === 'supply-chain-7'); | ||
const strategicAction = strategicActions.find((strategicAction) => strategicAction.fields.supply_chain === supplyChain.pk && strategicAction.fields.slug === 'sa-title-test') | ||
const strategicActionUpdate = strategicActionUpdates.find((strategicActionUpdate) => strategicActionUpdate.fields.strategic_action === strategicAction.pk && strategicActionUpdate.fields.slug === '05-2021'); | ||
|
||
import { urlBuilder } from "../support/utils.js" | ||
|
||
const urls = urlBuilder(supplyChain, strategicAction, strategicActionUpdate); | ||
|
||
const expectedTitles = { | ||
home: () => 'Update supply chain information', | ||
supplyChain: { | ||
taskList: () => `Update ${supplyChain.fields.name} – ${expectedTitles.home()}`, | ||
summary: () => `Summary – ${supplyChain.fields.name} – ${expectedTitles.home()}`, | ||
strategicActions: { | ||
summary: () => `Strategic actions – ${supplyChain.fields.name} – ${expectedTitles.home()}`, | ||
update: { | ||
info: () => `Update information - ${strategicAction.fields.name} update – ${supplyChain.fields.name} – ${expectedTitles.home()}`, | ||
timing: () => `Expected completion date - ${strategicAction.fields.name} update – ${supplyChain.fields.name} – ${expectedTitles.home()}`, | ||
status: () => `Current delivery status - ${strategicAction.fields.name} update – ${supplyChain.fields.name} – ${expectedTitles.home()}`, | ||
revisedTiming: () => `Revised expected completion date - ${strategicAction.fields.name} update – ${supplyChain.fields.name} – ${expectedTitles.home()}`, | ||
confirm: () => `Check your answers - ${strategicAction.fields.name} update – ${supplyChain.fields.name} – ${expectedTitles.home()}`, | ||
review: () => `Current monthly update - ${strategicAction.fields.name} – ${supplyChain.fields.name} – ${expectedTitles.home()}`, | ||
} | ||
}, | ||
updateComplete: () => `Update complete – ${supplyChain.fields.name} – ${expectedTitles.home()}`, | ||
} | ||
}; | ||
|
||
|
||
describe('The Home Page', () => { | ||
it('has the correct title', () => { | ||
cy.visit(urls.home); | ||
cy.title().should('equal', expectedTitles.home()); | ||
}); | ||
}); | ||
|
||
describe('The Task List page', () => { | ||
it('has the correct title', () => { | ||
cy.visit(urls.supplyChain.taskList); | ||
cy.title().should('equal', expectedTitles.supplyChain.taskList()) | ||
}); | ||
}); | ||
|
||
describe('The Supply Chain Summary page', () => { | ||
it('has the correct title', () => { | ||
cy.visit(urls.supplyChain.summary); | ||
cy.title().should('equal', expectedTitles.supplyChain.summary()) | ||
}); | ||
}); | ||
|
||
describe('The Strategic Actions Summary page', () => { | ||
it('has the correct title', () => { | ||
cy.visit(urls.supplyChain.strategicActions.summary); | ||
cy.title().should('equal', expectedTitles.supplyChain.strategicActions.summary()) | ||
}); | ||
}); | ||
|
||
describe('The Strategic Action Update Info page', () => { | ||
it('has the correct title', () => { | ||
cy.visit(urls.supplyChain.strategicActions.update.info); | ||
cy.title().should('equal', expectedTitles.supplyChain.strategicActions.update.info()) | ||
}); | ||
}); | ||
|
||
describe('The Strategic Action Update Timing page', () => { | ||
it('has the correct title', () => { | ||
cy.visit(urls.supplyChain.strategicActions.update.timing); | ||
cy.title().should('equal', expectedTitles.supplyChain.strategicActions.update.timing()) | ||
}); | ||
}); | ||
|
||
describe('The Strategic Action Update Status page', () => { | ||
it('has the correct title', () => { | ||
cy.visit(urls.supplyChain.strategicActions.update.status); | ||
cy.title().should('equal', expectedTitles.supplyChain.strategicActions.update.status()) | ||
}); | ||
}); | ||
|
||
describe('The Strategic Action Update Revised Timing page', () => { | ||
it('has the correct title', () => { | ||
cy.visit(urls.supplyChain.strategicActions.update.revisedTiming); | ||
cy.title().should('equal', expectedTitles.supplyChain.strategicActions.update.revisedTiming()) | ||
}); | ||
}); | ||
|
||
describe('The Strategic Action Update Check Your Answers page', () => { | ||
it('has the correct title', () => { | ||
cy.visit(urls.supplyChain.strategicActions.update.confirm); | ||
cy.title().should('equal', expectedTitles.supplyChain.strategicActions.update.confirm()) | ||
}); | ||
}); | ||
|
||
describe('The Strategic Action Update Complete page', () => { | ||
it('has the correct title', () => { | ||
cy.visit(urls.supplyChain.taskList); | ||
cy.mainForm().submitButton().click() | ||
cy.title().should('equal', expectedTitles.supplyChain.updateComplete()) | ||
}); | ||
}); | ||
|
||
describe('The Strategic Action Update Review page', () => { | ||
it('has the correct title', () => { | ||
cy.visit(urls.supplyChain.taskList); | ||
cy.get(`#updates .govuk-link[href="${urls.supplyChain.strategicActions.update.review}"]`).click() | ||
cy.title().should('equal', expectedTitles.supplyChain.strategicActions.update.review()) | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
defend_data_capture/supply_chains/templates/strategic_action_summary.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
defend_data_capture/supply_chains/templates/supply_chains/monthly_update_form_base.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
defend_data_capture/supply_chains/templates/supply_chains/monthly_update_info_form.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
...ata_capture/supply_chains/templates/supply_chains/monthly_update_revised_timing_form.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
defend_data_capture/supply_chains/templates/supply_chains/monthly_update_status_form.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
defend_data_capture/supply_chains/templates/supply_chains/monthly_update_summary.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
defend_data_capture/supply_chains/templates/supply_chains/monthly_update_timing_form.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
defend_data_capture/supply_chains/templates/task_complete.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters