Skip to content

Commit

Permalink
fix: added UpdateTask to interface (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
theantichris authored Jan 13, 2021
1 parent 35d5277 commit e6e42c4
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## 0.1.2 (2021-01-12)

### Fixes

* Updated interface with UpdateTask

## 0.1.1 (2021-01-12)

### Features
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ The library will parse ClickUp Webhooks from an HTTP request.

The library will fetch a Task by Task ID.

### Update Task

The library will update an existing Task.

### Mocking

Full mocks for all features are included to make testing consuming modules easier.
1 change: 1 addition & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type CUClient interface {
VerifySignature(signature string, body []byte) error
ParseWebhook(body io.ReadCloser) (Webhook, error)
GetTask(taskID string) (Task, error)
UpdateTask(taskID string, task UpdateTaskRequest) error
}

const apiURL = "https://api.clickup.com/api/v2"
Expand Down
10 changes: 10 additions & 0 deletions mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type MockClient struct {
VerifySignatureError bool
ParseWebhookError bool
GetTaskError bool
UpdateTaskError bool
}

// GetTask mock fetches and returns a Task from ClickUp.
Expand Down Expand Up @@ -43,3 +44,12 @@ func (c MockClient) VerifySignature(signature string, body []byte) error {

return nil
}

// UpdateTask mocks makes changes to a Task on ClickUp.
func (c MockClient) UpdateTask(taskID string, task UpdateTaskRequest) error {
if c.UpdateTaskError {
return ErrTest
}

return nil
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clickup-go",
"version": "0.1.1",
"version": "0.1.2",
"private": true,
"description": "A client for using the ClickUp API.",
"repository": "git+https://github.com/theartofeducation/clickup-go.git",
Expand Down

0 comments on commit e6e42c4

Please sign in to comment.