Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: api endpoints for project boards #28209

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4c0ec22
test: add 2 fixtures for project
dineshsalunke Nov 18, 2023
6092b81
refactor: add structs for project
dineshsalunke Nov 18, 2023
b6f9d05
feat: api for projects
dineshsalunke Nov 18, 2023
b6d45c6
Merge branch 'main' into feat/api-projects
dineshsalunke Nov 20, 2023
922cd13
Merge remote-tracking branch 'upstream/main' into feat/api-projects
dineshsalunke Nov 20, 2023
0b8d198
Merge branch 'feat/api-projects' of https://github.com/dineshsalunke/…
dineshsalunke Nov 20, 2023
44f20b3
refactor: add structs for board
dineshsalunke Nov 25, 2023
d8447fa
refactor: add the swagger related structs
dineshsalunke Nov 25, 2023
35ba105
feat: api endpoints for the boards
dineshsalunke Nov 25, 2023
26c9282
Merge remote-tracking branch 'upstream/main' into feat/api-project-bo…
dineshsalunke Nov 25, 2023
ebcafb5
chore: remove unwanted formatting on line
dineshsalunke Jan 16, 2024
7b19a66
Merge remote-tracking branch 'upstream/main' into feat/api-project-bo…
dineshsalunke Jan 17, 2024
937c027
refactor: update for db find method usage
dineshsalunke Jan 17, 2024
f5688db
refactor: fix swagger doc issues
dineshsalunke Jan 17, 2024
19c5e2f
Merge remote-tracking branch 'upstream/main' into feat/api-project-bo…
dineshsalunke Jan 22, 2024
313d160
revert formatting changes
denyskon Jan 21, 2024
c4f832c
more reverts
denyskon Jan 21, 2024
159ec84
more formatting fixes
denyskon Jan 21, 2024
a466ddf
fix project sort test
denyskon Jan 21, 2024
5f4e945
refactor: use the add token auth method for token in tests
dineshsalunke Jan 17, 2024
eeae271
test: use the add token auth method for token
dineshsalunke Jan 17, 2024
5ad5dc6
refactor: use the correct variable naming
dineshsalunke Jan 22, 2024
383be30
chore: formatting fixs
dineshsalunke Jan 22, 2024
33c5722
test: use the add token auth method on request
dineshsalunke Jan 22, 2024
f34c052
fix: ignore errors when loading data for converting project to response
dineshsalunke Jan 17, 2024
2ebe4f0
refactor: use the correct variable naming
dineshsalunke Jan 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: use the add token auth method on request
  • Loading branch information
dineshsalunke committed Jan 22, 2024
commit 33c5722776e6dfc862e6f488b603ea149e419ab1
20 changes: 10 additions & 10 deletions tests/integration/api_project_board_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ func TestAPICreateProjectBoard(t *testing.T) {
defer tests.PrepareTestEnv(t)()
token := getUserToken(t, "user2", auth_model.AccessTokenScopeWriteIssue)

link, _ := url.Parse(fmt.Sprintf("/api/v1/projects/%d/boards?token=%s", 1, token))
link, _ := url.Parse(fmt.Sprintf("/api/v1/projects/%d/boards", 1))

req := NewRequestWithJSON(t, "POST", link.String(), &api.NewProjectBoardPayload{
Title: "Unused",
})
}).AddTokenAuth(token)
resp := MakeRequest(t, req, http.StatusCreated)

var apiProjectBoard *api.ProjectBoard
Expand All @@ -40,9 +40,9 @@ func TestAPIListProjectBoards(t *testing.T) {

token := getUserToken(t, "user2", auth_model.AccessTokenScopeWriteIssue)

link, _ := url.Parse(fmt.Sprintf("/api/v1/projects/%d/boards?token=%s", 1, token))
link, _ := url.Parse(fmt.Sprintf("/api/v1/projects/%d/boards", 1))

req := NewRequest(t, "GET", link.String())
req := NewRequest(t, "GET", link.String()).AddTokenAuth(token)
resp := MakeRequest(t, req, http.StatusOK)

var apiProjectBoards []*api.ProjectBoard
Expand All @@ -56,9 +56,9 @@ func TestAPIGetProjectBoard(t *testing.T) {

token := getUserToken(t, "user2", auth_model.AccessTokenScopeReadIssue)

link, _ := url.Parse(fmt.Sprintf("/api/v1/projects/boards/%d?token=%s", 1, token))
link, _ := url.Parse(fmt.Sprintf("/api/v1/projects/boards/%d", 1))

req := NewRequest(t, "GET", link.String())
req := NewRequest(t, "GET", link.String()).AddTokenAuth(token)
resp := MakeRequest(t, req, http.StatusOK)

var apiProjectBoard *api.ProjectBoard
Expand All @@ -71,11 +71,11 @@ func TestAPIUpdateProjectBoard(t *testing.T) {
defer tests.PrepareTestEnv(t)()
token := getUserToken(t, "user2", auth_model.AccessTokenScopeWriteIssue)

link, _ := url.Parse(fmt.Sprintf("/api/v1/projects/boards/%d?token=%s", 1, token))
link, _ := url.Parse(fmt.Sprintf("/api/v1/projects/boards/%d", 1))

req := NewRequestWithJSON(t, "PATCH", link.String(), &api.UpdateProjectBoardPayload{
Title: "Unused",
})
}).AddTokenAuth(token)
resp := MakeRequest(t, req, http.StatusOK)

var apiProjectBoard *api.ProjectBoard
Expand All @@ -92,9 +92,9 @@ func TestAPIDeleteProjectBoard(t *testing.T) {

token := getUserToken(t, "user2", auth_model.AccessTokenScopeWriteIssue)

link, _ := url.Parse(fmt.Sprintf("/api/v1/projects/boards/%d?token=%s", 1, token))
link, _ := url.Parse(fmt.Sprintf("/api/v1/projects/boards/%d", 1))

req := NewRequest(t, "DELETE", link.String())
req := NewRequest(t, "DELETE", link.String()).AddTokenAuth(token)
MakeRequest(t, req, http.StatusNoContent)

unittest.AssertNotExistsBean(t, &project_model.Board{ID: 1})
Expand Down
Loading