-
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: Make email optional, channel required for create trust co…
…rporation (#188)
- Loading branch information
Showing
2 changed files
with
31 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,10 +100,10 @@ func TestValidateTrustCorporationEmpty(t *testing.T) { | |
|
||
assert.Contains(t, errors, shared.FieldError{Source: "/test/name", Detail: "field is required"}) | ||
assert.Contains(t, errors, shared.FieldError{Source: "/test/companyNumber", Detail: "field is required"}) | ||
assert.Contains(t, errors, shared.FieldError{Source: "/test/email", Detail: "field is required"}) | ||
assert.Contains(t, errors, shared.FieldError{Source: "/test/status", 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"}) | ||
} | ||
|
||
func TestValidateTrustCorporationValid(t *testing.T) { | ||
|
@@ -114,6 +114,7 @@ func TestValidateTrustCorporationValid(t *testing.T) { | |
Email: "[email protected]", | ||
Address: validAddress, | ||
Status: shared.AttorneyStatusActive, | ||
Channel: shared.ChannelOnline, | ||
} | ||
errors := validateTrustCorporation("/test", trustCorporation) | ||
|
||
|
@@ -298,6 +299,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"}, | ||
// }, | ||
//}, | ||
} | ||
|
||
for name, tc := range testcases { | ||
|