-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MLPAB-2088: Match old and existing update values on TRUST_CORPORATION…
…_SIGN (#190)
- Loading branch information
Showing
16 changed files
with
183 additions
and
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,8 +23,8 @@ | |
}, | ||
{ | ||
"key": "/attorneys/0/email", | ||
"new": "b@example.com", | ||
"old": "[email protected]" | ||
"new": "a@example.com", | ||
"old": 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,6 @@ | |
"country": "GB" | ||
}, | ||
"dateOfBirth": "1982-07-24", | ||
"email": "[email protected]", | ||
"status": "active", | ||
"channel": "paper" | ||
} | ||
|
@@ -39,7 +38,6 @@ | |
"town": "Town", | ||
"country": "GB" | ||
}, | ||
"email": "[email protected]", | ||
"status": "active", | ||
"channel": "paper" | ||
} | ||
|
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
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
|
@@ -18,8 +18,8 @@ | |
}, | ||
{ | ||
"key": "/trustCorporations/0/email", | ||
"new": "b@example.com", | ||
"old": "[email protected]" | ||
"new": "a@example.com", | ||
"old": null | ||
}, | ||
{ | ||
"key": "/trustCorporations/0/signatories/0/firstNames", | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,8 @@ func TestValidateAttorneyEmpty(t *testing.T) { | |
assert.Contains(t, errors, shared.FieldError{Source: "/test/dateOfBirth", Detail: "field is required"}) | ||
assert.Contains(t, errors, shared.FieldError{Source: "/test/address/line1", Detail: "field is required"}) | ||
assert.Contains(t, errors, shared.FieldError{Source: "/test/address/country", Detail: "field is required"}) | ||
assert.Contains(t, errors, shared.FieldError{Source: "/test/channel", Detail: "field is required"}) | ||
assert.Contains(t, errors, shared.FieldError{Source: "/test/uid", Detail: "field is required"}) | ||
} | ||
|
||
func TestValidateAttorneyValid(t *testing.T) { | ||
|
@@ -58,6 +60,8 @@ func TestValidateAttorneyValid(t *testing.T) { | |
}, | ||
DateOfBirth: newDate("1928-01-18"), | ||
Status: shared.AttorneyStatusActive, | ||
Channel: shared.ChannelOnline, | ||
Email: "[email protected]", | ||
} | ||
errors := validateAttorney("/test", attorney) | ||
|
||
|
@@ -67,6 +71,7 @@ func TestValidateAttorneyValid(t *testing.T) { | |
func TestValidateAttorneyMalformedDateOfBirth(t *testing.T) { | ||
attorney := shared.Attorney{ | ||
Person: shared.Person{ | ||
UID: "0a266ff6-1c7b-49b7-acd0-047f1dcda2ce", | ||
FirstNames: "Lesia", | ||
LastName: "Lathim", | ||
Address: validAddress, | ||
|
@@ -82,6 +87,7 @@ func TestValidateAttorneyMalformedDateOfBirth(t *testing.T) { | |
func TestValidateAttorneyInvalidStatus(t *testing.T) { | ||
attorney := shared.Attorney{ | ||
Person: shared.Person{ | ||
UID: "0a266ff6-1c7b-49b7-acd0-047f1dcda2ce", | ||
FirstNames: "Lesia", | ||
LastName: "Lathim", | ||
Address: validAddress, | ||
|
@@ -104,6 +110,7 @@ func TestValidateTrustCorporationEmpty(t *testing.T) { | |
assert.Contains(t, errors, shared.FieldError{Source: "/test/address/line1", Detail: "field is required"}) | ||
assert.Contains(t, errors, shared.FieldError{Source: "/test/address/country", Detail: "field is required"}) | ||
assert.Contains(t, errors, shared.FieldError{Source: "/test/channel", Detail: "field is required"}) | ||
assert.Contains(t, errors, shared.FieldError{Source: "/test/uid", Detail: "field is required"}) | ||
} | ||
|
||
func TestValidateTrustCorporationValid(t *testing.T) { | ||
|
@@ -203,6 +210,33 @@ func TestValidateLpaInvalid(t *testing.T) { | |
{Source: "/howAttorneysMakeDecisionsDetails", Detail: "field must not be provided"}, | ||
}, | ||
}, | ||
"online attorney missing email": { | ||
lpa: shared.LpaInit{ | ||
Attorneys: []shared.Attorney{ | ||
{ | ||
Channel: shared.ChannelOnline, | ||
Status: shared.AttorneyStatusActive, | ||
}, | ||
}, | ||
}, | ||
contains: []shared.FieldError{ | ||
{Source: "/attorneys/0/email", Detail: "field is required"}, | ||
}, | ||
}, | ||
"paper attorney with email": { | ||
lpa: shared.LpaInit{ | ||
Attorneys: []shared.Attorney{ | ||
{ | ||
Channel: shared.ChannelPaper, | ||
Email: "[email protected]", | ||
Status: shared.AttorneyStatusActive, | ||
}, | ||
}, | ||
}, | ||
contains: []shared.FieldError{ | ||
{Source: "/attorneys/0/email", Detail: "field must not be provided"}, | ||
}, | ||
}, | ||
"single replacement attorney with decisions": { | ||
lpa: shared.LpaInit{ | ||
Attorneys: []shared.Attorney{{Status: shared.AttorneyStatusReplacement}}, | ||
|
@@ -299,31 +333,31 @@ func TestValidateLpaInvalid(t *testing.T) { | |
{Source: "/lifeSustainingTreatmentOption", Detail: "field must not be provided"}, | ||
}, | ||
}, | ||
//"online trust corporation missing email": { | ||
// lpa: shared.LpaInit{ | ||
// TrustCorporations: []shared.TrustCorporation{ | ||
// { | ||
// Channel: shared.ChannelOnline, | ||
// }, | ||
// }, | ||
// }, | ||
// contains: []shared.FieldError{ | ||
// {Source: "/trustCorporations/0/email", Detail: "field is required"}, | ||
// }, | ||
//}, | ||
//"paper trust corporation with email": { | ||
// lpa: shared.LpaInit{ | ||
// TrustCorporations: []shared.TrustCorporation{ | ||
// { | ||
// Channel: shared.ChannelPaper, | ||
// Email: "[email protected]", | ||
// }, | ||
// }, | ||
// }, | ||
// contains: []shared.FieldError{ | ||
// {Source: "/trustCorporations/0/email", Detail: "field must not be provided"}, | ||
// }, | ||
//}, | ||
"online trust corporation missing email": { | ||
lpa: shared.LpaInit{ | ||
TrustCorporations: []shared.TrustCorporation{ | ||
{ | ||
Channel: shared.ChannelOnline, | ||
}, | ||
}, | ||
}, | ||
contains: []shared.FieldError{ | ||
{Source: "/trustCorporations/0/email", Detail: "field is required"}, | ||
}, | ||
}, | ||
"paper trust corporation with email": { | ||
lpa: shared.LpaInit{ | ||
TrustCorporations: []shared.TrustCorporation{ | ||
{ | ||
Channel: shared.ChannelPaper, | ||
Email: "[email protected]", | ||
}, | ||
}, | ||
}, | ||
contains: []shared.FieldError{ | ||
{Source: "/trustCorporations/0/email", Detail: "field must not be provided"}, | ||
}, | ||
}, | ||
} | ||
|
||
for name, tc := range testcases { | ||
|
@@ -360,6 +394,7 @@ func TestValidateLpaValid(t *testing.T) { | |
DateOfBirth: newDate("1977-10-30"), | ||
Status: shared.AttorneyStatusActive, | ||
Channel: shared.ChannelOnline, | ||
Email: "[email protected]", | ||
}, | ||
}, | ||
CertificateProvider: shared.CertificateProvider{ | ||
|
@@ -373,8 +408,20 @@ func TestValidateLpaValid(t *testing.T) { | |
Email: "[email protected]", | ||
Channel: shared.ChannelOnline, | ||
}, | ||
TrustCorporations: []shared.TrustCorporation{ | ||
{ | ||
UID: "af2f7aa6-2f8e-4311-af2a-4855c4686d30", | ||
Name: "corp", | ||
CompanyNumber: "5", | ||
Email: "[email protected]", | ||
Address: validAddress, | ||
Status: shared.AttorneyStatusActive, | ||
Channel: shared.ChannelOnline, | ||
}, | ||
}, | ||
LifeSustainingTreatmentOption: shared.LifeSustainingTreatmentOptionA, | ||
SignedAt: time.Now(), | ||
HowAttorneysMakeDecisions: shared.HowMakeDecisionsJointly, | ||
} | ||
errors := Validate(lpa) | ||
|
||
|
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
Oops, something went wrong.