This commit is contained in:
2026-07-12 12:20:23 +08:00
parent 7f2d5579ff
commit f923791d39
252 changed files with 9872 additions and 647 deletions
@@ -65,6 +65,15 @@ func setupChatwootAuthTest(t *testing.T) (*gin.Engine, *gorm.DB, *model.User) {
return router, db, user
}
func TestRegisterAuthRoutesDoesNotExposeSelfRegistration(t *testing.T) {
router := gin.New()
RegisterAuthRoutes(router.Group("/api/v1"), &AuthHandler{})
for _, route := range router.Routes() {
require.NotEqual(t, "/api/v1/auth/register", route.Path)
}
}
func TestChatwootAuthSignInReturnsDeviseHeadersAndUserPayload(t *testing.T) {
router, _, _ := setupChatwootAuthTest(t)
body, _ := json.Marshal(map[string]string{"email": " AUTH@example.com ", "password": "password123"})