|
| 1 | +import ConfirmSwapVosPinCreditDetailsPage from '../pages/confirmSwapVosPinCreditDetailsPage' |
| 2 | +import Page from '../pages/page' |
| 3 | + |
| 4 | +context('Confirm Swap VOs for PIN Credit Details Page', () => { |
| 5 | + let page: ConfirmSwapVosPinCreditDetailsPage |
| 6 | + |
| 7 | + beforeEach(() => { |
| 8 | + cy.task('reset') |
| 9 | + cy.task('stubSignIn') |
| 10 | + cy.signIn() |
| 11 | + |
| 12 | + cy.visit('/log/swap-vos-pin-credit-details/confirm') |
| 13 | + |
| 14 | + cy.contains('Swap visiting orders (VOs) for PIN credit').click() |
| 15 | + cy.contains('button', 'Continue').click() |
| 16 | + cy.contains('button', 'Continue').click() |
| 17 | + cy.contains('button', 'Continue').click() |
| 18 | + |
| 19 | + page = Page.verifyOnPage(ConfirmSwapVosPinCreditDetailsPage) |
| 20 | + }) |
| 21 | + |
| 22 | + it('should display the correct page title', () => { |
| 23 | + page.pageTitle().should('include', 'Check details') |
| 24 | + }) |
| 25 | + |
| 26 | + it('should render the back link with correct text and href', () => { |
| 27 | + page.backLink().should('have.text', 'Back').and('have.attr', 'href', '/log/swap-vos-pin-credit-details') |
| 28 | + }) |
| 29 | + |
| 30 | + it('should render the application type summary with correct text', () => { |
| 31 | + page.applicationType().should('contain.text', 'Swap VOs for pin credit') |
| 32 | + }) |
| 33 | + |
| 34 | + it('should allow changing the application type', () => { |
| 35 | + page.changeApplicationType().should('exist').and('have.attr', 'href', '#') |
| 36 | + }) |
| 37 | + |
| 38 | + it('should render prisoner name summary with correct text', () => { |
| 39 | + page.prisonerName().should('exist') |
| 40 | + }) |
| 41 | + |
| 42 | + it('should allow changing the prisoner details', () => { |
| 43 | + page.changePrisoner().should('exist').and('have.attr', 'href', '#') |
| 44 | + }) |
| 45 | + |
| 46 | + it('should display the submitted on date', () => { |
| 47 | + page.submittedOn().should('exist') |
| 48 | + }) |
| 49 | + |
| 50 | + it('should allow changing the submission date', () => { |
| 51 | + page.changeSubmittedOn().should('exist').and('have.attr', 'href', '#') |
| 52 | + }) |
| 53 | + |
| 54 | + it('should display the VOs to swap details', () => { |
| 55 | + page.swapVOsDetails().should('exist') |
| 56 | + }) |
| 57 | + |
| 58 | + it('should allow changing the swap VOs details', () => { |
| 59 | + page.changeSwapVOsDetails().should('exist').and('have.attr', 'href', '#') |
| 60 | + }) |
| 61 | + |
| 62 | + it('should render a Continue button with the correct text', () => { |
| 63 | + page.continueButton().should('contain.text', 'Continue') |
| 64 | + }) |
| 65 | +}) |
0 commit comments