Skip to content

Commit

Permalink
feat: add domain sdk tests
Browse files Browse the repository at this point in the history
Signed-off-by: 1998-felix <felix.gateru@gmail.com>
  • Loading branch information
felixgateru committed Jun 5, 2024
1 parent 3e23807 commit 24e9019
Show file tree
Hide file tree
Showing 3 changed files with 1,056 additions and 4 deletions.
2 changes: 1 addition & 1 deletion auth/api/http/domains/endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ func TestAssignDomainUsers(t *testing.T) {
contentType: contentType,
token: validToken,
status: http.StatusBadRequest,
err: apiutil.ErrMalformedPolicy,
err: apiutil.ErrMissingRelation,
},
}

Expand Down
6 changes: 3 additions & 3 deletions auth/api/http/domains/requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ func (req assignUsersReq) validate() error {
}

if len(req.UserIDs) == 0 {
return apiutil.ErrMalformedPolicy
return apiutil.ErrMissingID
}

if req.Relation == "" {
return apiutil.ErrMalformedPolicy
return apiutil.ErrMissingRelation
}

return nil
Expand All @@ -202,7 +202,7 @@ func (req unassignUsersReq) validate() error {
}

if len(req.UserIDs) == 0 {
return apiutil.ErrMalformedPolicy
return apiutil.ErrMissingID
}

return nil
Expand Down
Loading

0 comments on commit 24e9019

Please sign in to comment.