fix(t233): add redacted ERP diagnostics

This commit is contained in:
QiuSW
2026-07-29 11:24:04 +08:00
parent 817a968233
commit 1e703ef257
14 changed files with 412 additions and 28 deletions
@@ -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)
}
}
}