fix(t233): add redacted ERP diagnostics
This commit is contained in:
@@ -25,3 +25,21 @@ func TestMapFreightPreflightErrorUsesStablePublicErrors(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestMapFreightCreateErrorPreservesPreflightErrors(t *testing.T) {
|
||||
for _, testCase := range []struct {
|
||||
err error
|
||||
want error
|
||||
}{
|
||||
{domain.ErrFreightSourceOCRInvalid, ErrOCRServiceInvalid},
|
||||
{domain.ErrFreightSourceNotConfigured, ErrERPNotConfigured},
|
||||
{domain.ErrFreightSourceLoginRejected, ErrERPLoginRejected},
|
||||
{domain.ErrFreightSourceProtocol, ErrERPProtocol},
|
||||
{domain.ErrFreightSourceUnavailable, ErrERPUnavailable},
|
||||
} {
|
||||
actual := mapFreightCreateError(testCase.err)
|
||||
if !errors.Is(actual, testCase.want) || !errors.Is(actual, testCase.err) {
|
||||
t.Fatalf("mapFreightCreateError(%v) = %v", testCase.err, actual)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user