Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
weblate committed Jun 12, 2024
2 parents 9d35635 + 6037391 commit 17ffc91
Show file tree
Hide file tree
Showing 32 changed files with 412 additions and 240 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe('Legal rights and responsibilities', () => {
it('can continue to next page', () => {
cy.visit('/fixtures/attorney?redirect=/legal-rights-and-responsibilities');
cy.visit('/fixtures/attorney?redirect=/legal-rights-and-responsibilities&progress=readTheLPA');

cy.contains('h1', "Your legal rights and responsibilities")

Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/attorney/sign.cy.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
describe('Sign', () => {
describe('as an attorney', () => {
beforeEach(() => {
cy.visit('/fixtures/attorney?redirect=/sign&progress=signedByCertificateProvider');
cy.visit('/fixtures/attorney?redirect=/sign&progress=readTheLPA');
});

it('can be signed', () => {
Expand Down Expand Up @@ -31,7 +31,7 @@ describe('Sign', () => {

describe('as a replacement attorney', () => {
beforeEach(() => {
cy.visit('/fixtures/attorney?redirect=/sign&is-replacement=1&progress=signedByCertificateProvider');
cy.visit('/fixtures/attorney?redirect=/sign&is-replacement=1&progress=readTheLPA');
});

it('can be signed', () => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/attorney/trust-corporation.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { TestMobile, TestEmail, randomShareCode } = require("../../support/e2e");
describe('As a trust corporation', () => {
beforeEach(() => {
const shareCode = randomShareCode()
cy.visit(`/fixtures/attorney?redirect=/attorney-start&is-trust-corporation=1&progress=signedByCertificateProvider&&withShareCode=${shareCode}&email=${TestEmail}`);
cy.visit(`/fixtures/attorney?redirect=/attorney-start&is-trust-corporation=1&progress=readTheLPA&&withShareCode=${shareCode}&email=${TestEmail}`);

// start
cy.contains('a', 'Start').click();
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/attorney/what-happens-when-you-sign-the-lpa.cy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe('What happens when you sign the LPA', () => {
it('as a property and affairs attorney', () => {
cy.visit('/fixtures/attorney?redirect=/what-happens-when-you-sign-the-lpa&progress=signedByCertificateProvider');
cy.visit('/fixtures/attorney?redirect=/what-happens-when-you-sign-the-lpa&progress=readTheLPA');

cy.contains('h1', "What happens when you sign the LPA")
cy.contains('p', "you’re officially saying that you want to be an attorney on")
Expand All @@ -13,23 +13,23 @@ describe('What happens when you sign the LPA', () => {
});

it('as a personal welfare attorney', () => {
cy.visit('/fixtures/attorney?redirect=/what-happens-when-you-sign-the-lpa&lpa-type=personal-welfare&progress=signedByCertificateProvider');
cy.visit('/fixtures/attorney?redirect=/what-happens-when-you-sign-the-lpa&lpa-type=personal-welfare&progress=readTheLPA');

cy.contains('p', "you’re officially saying that you want to be an attorney on")
cy.contains('li', "their personal and medical care")
cy.contains('strong', "cannot act on their behalf")
});

it('as a property and affairs replacement attorney', () => {
cy.visit('/fixtures/attorney?redirect=/what-happens-when-you-sign-the-lpa&progress=signedByCertificateProvider&is-replacement=1');
cy.visit('/fixtures/attorney?redirect=/what-happens-when-you-sign-the-lpa&progress=readTheLPA&is-replacement=1');

cy.contains('p', "you’re saying that you want to be a replacement attorney")
cy.contains('li', "make decisions about their money or property")
cy.contains('strong', "should only do these things if the donor asks you to")
});

it('as a personal welfare replacement attorney', () => {
cy.visit('/fixtures/attorney?redirect=/what-happens-when-you-sign-the-lpa&lpa-type=personal-welfare&progress=signedByCertificateProvider&is-replacement=1');
cy.visit('/fixtures/attorney?redirect=/what-happens-when-you-sign-the-lpa&lpa-type=personal-welfare&progress=readTheLPA&is-replacement=1');

cy.contains('p', "you’re saying that you want to be a replacement attorney ")
cy.contains('li', "their personal and medical care")
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/certificate-provider/certificate-provided.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('Certificate provided', () => {
cy.stub(win, 'print')
})

cy.visit('/fixtures/certificate-provider?redirect=/certificate-provided')
cy.visit('/fixtures/certificate-provider?redirect=/certificate-provided&progress=confirmYourIdentity')

cy.checkA11yApp();

Expand All @@ -13,7 +13,7 @@ describe('Certificate provided', () => {
});

it('has a button to the dashboard', () => {
cy.visit('/fixtures/certificate-provider?redirect=/certificate-provided')
cy.visit('/fixtures/certificate-provider?redirect=/certificate-provided&progress=confirmYourIdentity')

cy.contains('a', 'Go to your dashboard').click();
cy.url().should('contain', '/dashboard');
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/certificate-provider/provide-certificate.cy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe('Provide the certificate', () => {
beforeEach(() => {
cy.visit('/fixtures/certificate-provider?redirect=/provide-certificate&progress=signedByDonor');
cy.visit('/fixtures/certificate-provider?redirect=/provide-certificate&progress=confirmYourIdentity');
});

it('can provide the certificate', () => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/certificate-provider/read-the-lpa.cy.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
describe('Read the LPA', () => {
describe('when the LPA is signed', () => {
beforeEach(() => {
cy.visit('/fixtures/certificate-provider?redirect=/read-the-lpa&progress=signedByDonor');
cy.visit('/fixtures/certificate-provider?redirect=/read-the-lpa&progress=confirmYourIdentity');
});

it('displays the LPA details and goes to provide certificate', () => {
Expand Down
12 changes: 6 additions & 6 deletions cypress/e2e/donor/check-your-lpa.cy.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
describe('Check the LPA', () => {
it('cannot change when personal welfare LPA can be used', () => {
cy.visit('/fixtures?redirect=/check-your-lpa&progress=peopleToNotifyAboutYourLpa&lpa-type=personal-welfare');
cy.visit('/fixtures?redirect=/check-your-lpa&progress=addCorrespondent&lpa-type=personal-welfare');

cy.contains('.govuk-summary-list__row', 'When your attorneys can use your LPA')
.contains('Only when I do not have mental capacity')
.contains('Change').should('not.exist');
});

it("can submit the completed LPA", () => {
cy.visit('/fixtures?redirect=/check-your-lpa&progress=peopleToNotifyAboutYourLpa&[email protected]');
cy.visit('/fixtures?redirect=/check-your-lpa&progress=addCorrespondent&[email protected]');

cy.contains('h1', "Check your LPA")

Expand Down Expand Up @@ -45,7 +45,7 @@ describe('Check the LPA', () => {
});

it('does not allow checking when no changes', () => {
cy.visit('/fixtures?redirect=/check-your-lpa&progress=peopleToNotifyAboutYourLpa');
cy.visit('/fixtures?redirect=/check-your-lpa&progress=addCorrespondent');

cy.get('#f-checked-and-happy').check({ force: true })
cy.contains('button', 'Confirm').click();
Expand All @@ -64,7 +64,7 @@ describe('Check the LPA', () => {
describe('CP acting on paper', () => {
describe('on first check', () => {
it('content is tailored for paper CPs, a details component is shown and nav redirects to payment', () => {
cy.visit('/fixtures?redirect=/check-your-lpa&progress=peopleToNotifyAboutYourLpa&certificateProvider=paper');
cy.visit('/fixtures?redirect=/check-your-lpa&progress=addCorrespondent&certificateProvider=paper');

cy.get('label[for=f-checked-and-happy]').contains('I’ve checked this LPA and I’m happy to show it to my certificate provider, Charlie Cooper')
cy.get('details').contains('What happens if I need to make changes later?')
Expand Down Expand Up @@ -126,7 +126,7 @@ describe('Check the LPA', () => {
describe('CP acting online', () => {
describe('on first check', () => {
it('content is tailored for online CPs, a details component is shown and nav redirects to payment', () => {
cy.visit('/fixtures?redirect=/check-your-lpa&progress=peopleToNotifyAboutYourLpa');
cy.visit('/fixtures?redirect=/check-your-lpa&progress=addCorrespondent');

cy.get('label[for=f-checked-and-happy]').contains('I’ve checked this LPA and I’m happy for OPG to share it with my certificate provider, Charlie Cooper')
cy.get('details').contains('What happens if I need to make changes later?')
Expand Down Expand Up @@ -186,7 +186,7 @@ describe('Check the LPA', () => {
})

it("errors when not selected", () => {
cy.visit('/fixtures?redirect=/check-your-lpa&progress=peopleToNotifyAboutYourLpa');
cy.visit('/fixtures?redirect=/check-your-lpa&progress=addCorrespondent');
cy.contains('button', 'Confirm').click();

cy.get('.govuk-error-summary').within(() => {
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/donor/choose-replacement-attorneys.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { TestEmail } from "../../support/e2e";

describe('Choose replacement attorneys', () => {
beforeEach(() => {
cy.visit('/fixtures?redirect=/choose-replacement-attorneys');
cy.visit('/fixtures?redirect=/choose-replacement-attorneys&progress=chooseYourAttorneys');
});

it('can be submitted', () => {
Expand Down Expand Up @@ -84,7 +84,7 @@ describe('Choose replacement attorneys', () => {
});

it('warns when name shared with other actor', () => {
cy.visit('/fixtures?redirect=/choose-replacement-attorneys&progress=provideYourDetails');
cy.visit('/fixtures?redirect=/choose-replacement-attorneys&progress=chooseYourAttorneys');

cy.get('#f-first-names').type('Sam');
cy.get('#f-last-name').type('Smith');
Expand All @@ -101,7 +101,7 @@ describe('Choose replacement attorneys', () => {
});

it('permanently warns when date of birth is under 18', () => {
cy.visit('/fixtures?redirect=/choose-replacement-attorneys&progress=provideYourDetails');
cy.visit('/fixtures?redirect=/choose-replacement-attorneys&progress=chooseYourAttorneys');

cy.get('#f-first-names').type('John');
cy.get('#f-last-name').type('Doe');
Expand All @@ -124,7 +124,7 @@ describe('Choose replacement attorneys', () => {
});

it('warns when date of birth is over 100', () => {
cy.visit('/fixtures?redirect=/choose-replacement-attorneys&progress=provideYourDetails');
cy.visit('/fixtures?redirect=/choose-replacement-attorneys&progress=chooseYourAttorneys');

cy.get('#f-first-names').type('John');
cy.get('#f-last-name').type('Doe');
Expand Down
2 changes: 2 additions & 0 deletions cypress/e2e/donor/confirm-your-identity-and-sign.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ describe('Confirm your identity and sign', () => {
});

it('errors when not signed', () => {
cy.visit('/fixtures?redirect=/task-list&progress=confirmYourIdentity');

cy.visitLpa('/sign-your-lpa');

cy.contains('button', 'Submit my signature').click();
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/donor/life-sustaining-treatment.cy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe('Life sustaining treatment', () => {
beforeEach(() => {
cy.visit('/fixtures?redirect=/life-sustaining-treatment&lpa-type=personal-welfare');
cy.visit('/fixtures?redirect=/life-sustaining-treatment&lpa-type=personal-welfare&progress=chooseYourAttorneys');
});

it('can be agreed to', () => {
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/donor/people-to-notify.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ describe('People to notify', () => {
});

it('errors when unselected', () => {
cy.visit('/fixtures?redirect=/do-you-want-to-notify-people');
cy.visit('/fixtures?redirect=/do-you-want-to-notify-people&progress=chooseYourAttorneys');
cy.contains('button', 'Save and continue').click();

cy.get('.govuk-error-summary').within(() => {
Expand All @@ -162,7 +162,7 @@ describe('People to notify', () => {
});

it('errors when people to notify details empty', () => {
cy.visit('/fixtures?redirect=/choose-people-to-notify');
cy.visit('/fixtures?redirect=/choose-people-to-notify&progress=chooseYourAttorneys');
cy.contains('button', 'Save and continue').click();

cy.get('.govuk-error-summary').within(() => {
Expand All @@ -175,7 +175,7 @@ describe('People to notify', () => {
});

it('errors when people to notify details invalid', () => {
cy.visit('/fixtures?redirect=/choose-people-to-notify');
cy.visit('/fixtures?redirect=/choose-people-to-notify&progress=chooseYourAttorneys');

cy.get('#f-first-names').invoke('val', 'a'.repeat(54));
cy.get('#f-last-name').invoke('val', 'b'.repeat(62));
Expand All @@ -200,7 +200,7 @@ describe('People to notify', () => {
});

it('warns when name shared with other actor', () => {
cy.visit('/fixtures?redirect=/choose-people-to-notify&progress=provideYourDetails');
cy.visit('/fixtures?redirect=/choose-people-to-notify&progress=chooseYourAttorneys');

cy.get('#f-first-names').type('Sam');
cy.get('#f-last-name').type('Smith');
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/donor/restrictions.cy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe('Restrictions', () => {
beforeEach(() => {
cy.visit('/fixtures?redirect=/restrictions');
cy.visit('/fixtures?redirect=/restrictions&progress=chooseYourAttorneys');
});

it('can be submitted', () => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/donor/when-can-the-lpa-be-used.cy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe('When can the LPA be used', () => {
beforeEach(() => {
cy.visit('/fixtures?redirect=/when-can-the-lpa-be-used');
cy.visit('/fixtures?redirect=/when-can-the-lpa-be-used&progress=chooseYourAttorneys');
});

it('can be submitted', () => {
Expand Down
2 changes: 2 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ services:
build:
context: ..
dockerfile: docker/mock-lpa-store/Dockerfile
args:
IMPOSTER_VERSION: 3.40.0
volumes:
- ./mock-lpa-store/:/opt/imposter/config/
container_name: mock-lpa-store
Expand Down
7 changes: 5 additions & 2 deletions docker/mock-lpa-store/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
ARG IMPOSTER_VERSION=$IMPOSTER_VERSION

FROM badouralix/curl-jq:latest as build

RUN curl -L https://github.com/outofcoffee/imposter/releases/download/v3.36.0/imposter-plugin-js-graal.zip --output imposter-plugin-js-graal.zip
ARG IMPOSTER_VERSION=$IMPOSTER_VERSION
RUN curl -L "https://github.com/outofcoffee/imposter/releases/download/v${IMPOSTER_VERSION}/imposter-plugin-js-graal.zip" --output imposter-plugin-js-graal.zip

FROM outofcoffee/imposter:3.39.0
FROM outofcoffee/imposter:${IMPOSTER_VERSION}

COPY --from=build imposter-plugin-js-graal.zip /opt/imposter/plugins/imposter-plugin-js-graal.zip
Loading

0 comments on commit 17ffc91

Please sign in to comment.