Skip to content

Commit

Permalink
Merge pull request #1571 from ministryofjustice/MLPAB-2568-split-id-a…
Browse files Browse the repository at this point in the history
…nd-sign

MLPAB-2568 Split confirm identity and sign tasks
  • Loading branch information
hawx authored Oct 29, 2024
2 parents d1713f7 + 4f97bcd commit fb62008
Show file tree
Hide file tree
Showing 51 changed files with 754 additions and 773 deletions.
2 changes: 1 addition & 1 deletion cmd/event-received/sirius_event_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func handleFeeApproved(
if donor.FeeAmount() == 0 {
donor.Tasks.PayForLpa = task.PaymentStateCompleted

if donor.Tasks.ConfirmYourIdentityAndSign.IsCompleted() {
if donor.Tasks.SignTheLpa.IsCompleted() {
if err := lpaStoreClient.SendLpa(ctx, donor); err != nil {
return fmt.Errorf("failed to send to lpastore: %w", err)
}
Expand Down
10 changes: 5 additions & 5 deletions cmd/event-received/sirius_event_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func TestHandleFeeApproved(t *testing.T) {
PK: dynamo.LpaKey("123"),
SK: dynamo.LpaOwnerKey(dynamo.DonorKey("456")),
FeeType: pay.NoFee,
Tasks: donordata.Tasks{PayForLpa: task.PaymentStatePending, ConfirmYourIdentityAndSign: task.IdentityStateCompleted},
Tasks: donordata.Tasks{PayForLpa: task.PaymentStatePending, SignTheLpa: task.StateCompleted},
}

completedDonorProvided := donorProvided
Expand Down Expand Up @@ -216,7 +216,7 @@ func TestHandleFeeApprovedWhenNotPaid(t *testing.T) {
PK: dynamo.LpaKey("123"),
SK: dynamo.LpaOwnerKey(dynamo.DonorKey("456")),
FeeType: pay.HalfFee,
Tasks: donordata.Tasks{PayForLpa: task.PaymentStatePending, ConfirmYourIdentityAndSign: task.IdentityStateCompleted},
Tasks: donordata.Tasks{PayForLpa: task.PaymentStatePending, SignTheLpa: task.StateCompleted},
}

completedDonorProvided := donorProvided
Expand Down Expand Up @@ -407,7 +407,7 @@ func TestHandleFeeApprovedWhenShareCodeSenderError(t *testing.T) {
PK: dynamo.LpaKey("123"),
SK: dynamo.LpaOwnerKey(dynamo.DonorKey("456")),
FeeType: pay.NoFee,
Tasks: donordata.Tasks{PayForLpa: task.PaymentStatePending, ConfirmYourIdentityAndSign: task.IdentityStateCompleted},
Tasks: donordata.Tasks{PayForLpa: task.PaymentStatePending, SignTheLpa: task.StateCompleted},
})
attributevalue.Unmarshal(b, v)
return nil
Expand Down Expand Up @@ -453,7 +453,7 @@ func TestHandleFeeApprovedWhenEventClientError(t *testing.T) {
PK: dynamo.LpaKey("123"),
SK: dynamo.LpaOwnerKey(dynamo.DonorKey("456")),
FeeType: pay.NoFee,
Tasks: donordata.Tasks{PayForLpa: task.PaymentStatePending, ConfirmYourIdentityAndSign: task.IdentityStateCompleted},
Tasks: donordata.Tasks{PayForLpa: task.PaymentStatePending, SignTheLpa: task.StateCompleted},
})
attributevalue.Unmarshal(b, v)
return nil
Expand Down Expand Up @@ -494,7 +494,7 @@ func TestHandleFeeApprovedWhenLpaStoreError(t *testing.T) {
PK: dynamo.LpaKey("123"),
SK: dynamo.LpaOwnerKey(dynamo.DonorKey("456")),
FeeType: pay.NoFee,
Tasks: donordata.Tasks{PayForLpa: task.PaymentStatePending, ConfirmYourIdentityAndSign: task.IdentityStateCompleted},
Tasks: donordata.Tasks{PayForLpa: task.PaymentStatePending, SignTheLpa: task.StateCompleted},
})
attributevalue.Unmarshal(b, v)
return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('confirm your identity', () => {

cy.contains('li', 'Confirm your identity').should('contain', 'Not started').click();

cy.url().should('contain', '/prove-your-identity');
cy.url().should('contain', '/confirm-your-identity');
cy.checkA11yApp();

cy.contains('a', 'Continue').click()
Expand Down
40 changes: 20 additions & 20 deletions cypress/e2e/donor/check-your-details.cy.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
describe('Check your details', () => {
it('shows my details', () => {
cy.visit('/fixtures?redirect=/check-your-details&progress=confirmYourIdentity&idStatus=donor:insufficient-evidence&voucher=1');
it('shows my details', () => {
cy.visit('/fixtures?redirect=/check-your-details&progress=confirmYourIdentity&idStatus=donor:insufficient-evidence&voucher=1');

cy.checkA11yApp();
cy.contains('Sam Smith');
cy.contains('2 January 2000');
cy.contains('1 RICHMOND PLACE');
cy.contains('button', 'Continue').click();
cy.checkA11yApp();
cy.contains('Sam Smith');
cy.contains('2 January 2000');
cy.contains('1 RICHMOND PLACE');
cy.contains('button', 'Continue').click();

cy.url().should('contain', '/we-have-contacted-voucher');
cy.checkA11yApp();
cy.url().should('contain', '/we-have-contacted-voucher');
cy.checkA11yApp();

cy.contains('a', 'Continue').click();
cy.contains('a', 'Return to task list').click();

cy.url().should('contain', '/read-your-lpa');
cy.checkA11yApp();
});
cy.url().should('contain', '/task-list');
cy.checkA11yApp();
});

it('tells me about a pending payment', () => {
cy.visit('/fixtures?redirect=/check-your-details&progress=payForTheLpa&feeType=NoFee&paymentTaskProgress=Pending');
cy.contains('button', 'Continue').click();
it('tells me about a pending payment', () => {
cy.visit('/fixtures?redirect=/check-your-details&progress=payForTheLpa&feeType=NoFee&paymentTaskProgress=Pending');
cy.contains('button', 'Continue').click();

cy.url().should('contain', '/we-have-received-voucher-details');
cy.checkA11yApp();
cy.contains('no fee (exemption)');
});
cy.url().should('contain', '/we-have-received-voucher-details');
cy.checkA11yApp();
cy.contains('no fee (exemption)');
});
});
Loading

0 comments on commit fb62008

Please sign in to comment.