Skip to content

Commit

Permalink
Merge pull request stakwork#1802 from stakwork/feat/add_new_workspace…
Browse files Browse the repository at this point in the history
…_test

added empty test functions for new tests
  • Loading branch information
elraphty authored Jul 1, 2024
2 parents 242d5ed + 24b8ecf commit 4017bcc
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
21 changes: 21 additions & 0 deletions handlers/workspaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@ func CreateWorkspaceUser(w http.ResponseWriter, r *http.Request) {
workspaceUser := db.WorkspaceUsers{}
body, err := io.ReadAll(r.Body)
r.Body.Close()

if err != nil {
fmt.Println("[body] ", err)
w.WriteHeader(http.StatusNotAcceptable)
return
}

err = json.Unmarshal(body, &workspaceUser)

if workspaceUser.WorkspaceUuid == "" && workspaceUser.OrgUuid != "" {
Expand Down Expand Up @@ -278,6 +285,13 @@ func DeleteWorkspaceUser(w http.ResponseWriter, r *http.Request) {
workspaceUser := db.WorkspaceUsersData{}
body, err := io.ReadAll(r.Body)
r.Body.Close()

if err != nil {
fmt.Println("[body] ", err)
w.WriteHeader(http.StatusNotAcceptable)
return
}

err = json.Unmarshal(body, &workspaceUser)

if workspaceUser.WorkspaceUuid == "" && workspaceUser.OrgUuid != "" {
Expand Down Expand Up @@ -340,6 +354,13 @@ func AddUserRoles(w http.ResponseWriter, r *http.Request) {
roles := []db.WorkspaceUserRoles{}
body, err := io.ReadAll(r.Body)
r.Body.Close()

if err != nil {
fmt.Println("[body] ", err)
w.WriteHeader(http.StatusNotAcceptable)
return
}

err = json.Unmarshal(body, &roles)

if err != nil {
Expand Down
40 changes: 40 additions & 0 deletions handlers/workspaces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -647,3 +647,43 @@ func TestGetWorkspaceBountiesCount(t *testing.T) {
assert.Equal(t, bounty, fetchedBounty[0])
})
}

func TestAddUserRoles(t *testing.T) {

}

func TestGetUserRoles(t *testing.T) {

}

func TestCreateWorkspaceUser(t *testing.T) {

}

func TestGetWorkspaceUsers(t *testing.T) {

}

func TestGetUserDropdownWorkspaces(t *testing.T) {

}

func TestCreateOrEditWorkspaceRepository(t *testing.T) {

}

func TestGetWorkspaceRepositorByWorkspaceUuid(t *testing.T) {

}

func TestGetWorkspaceRepoByWorkspaceUuidAndRepoUuid(t *testing.T) {

}

func GetFeaturesByWorkspaceUuid(t *testing.T) {

}

func TestDeleteWorkspaceRepository(t *testing.T) {

}

0 comments on commit 4017bcc

Please sign in to comment.