From c5ed9e862279cd178e69b755a982d7750473a457 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Fri, 1 May 2026 09:35:18 +0800 Subject: [PATCH] test(errs): cover new project conflict codes in HTTPStatus table --- internal/infra/errs/errs_test.go | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/internal/infra/errs/errs_test.go b/internal/infra/errs/errs_test.go index 27f2837..a3cb1ed 100644 --- a/internal/infra/errs/errs_test.go +++ b/internal/infra/errs/errs_test.go @@ -29,15 +29,18 @@ func TestWrap_PreservesCause(t *testing.T) { func TestHTTPStatus(t *testing.T) { cases := map[Code]int{ - CodeInvalidInput: http.StatusBadRequest, - CodeUnauthorized: http.StatusUnauthorized, - CodeForbidden: http.StatusForbidden, - CodeNotFound: http.StatusNotFound, - CodeConflict: http.StatusConflict, - CodeRateLimited: http.StatusTooManyRequests, - CodeUpstream: http.StatusBadGateway, - CodeUnavailable: http.StatusServiceUnavailable, - CodeInternal: http.StatusInternalServerError, + CodeInvalidInput: http.StatusBadRequest, + CodeUnauthorized: http.StatusUnauthorized, + CodeForbidden: http.StatusForbidden, + CodeNotFound: http.StatusNotFound, + CodeConflict: http.StatusConflict, + CodeProjectSlugTaken: http.StatusConflict, + CodeProjectArchived: http.StatusConflict, + CodeRequirementClosed: http.StatusConflict, + CodeRateLimited: http.StatusTooManyRequests, + CodeUpstream: http.StatusBadGateway, + CodeUnavailable: http.StatusServiceUnavailable, + CodeInternal: http.StatusInternalServerError, } for code, want := range cases { require.Equal(t, want, HTTPStatus(code), "code=%s", code)