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

fix: change products and powerups type in organization struct #95

Merged
merged 2 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 8 additions & 8 deletions organization.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ import (
// https://developers.trello.com/reference/#organizations
type Organization struct {
client *Client
ID string `json:"id"`
Name string `json:"name"`
DisplayName string `json:"displayName"`
Desc string `json:"desc"`
URL string `json:"url"`
Website string `json:"website"`
Products []string `json:"products"`
PowerUps []string `json:"powerUps"`
ID string `json:"id"`
Name string `json:"name"`
DisplayName string `json:"displayName"`
Desc string `json:"desc"`
URL string `json:"url"`
Website string `json:"website"`
Products []int `json:"products"`
PowerUps []int `json:"powerUps"`
}

// GetOrganization takes an organization id and Arguments and either
Expand Down
12 changes: 12 additions & 0 deletions organization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ func TestGetOrganization(t *testing.T) {
if organization.DisplayName != "Culture Foundry" {
t.Errorf("Expected name 'Culture Foundry'. Got '%s'.", organization.DisplayName)
}
if len(organization.PowerUps) != 1 {
t.Errorf("Expected PowerUps to have length of 1 but was %d", len(organization.PowerUps))
}
if organization.PowerUps[0] != 42 {
t.Errorf("Expected first PowerUp to be %d but was %d", 42, organization.PowerUps[0])
}
if len(organization.Products) != 1 {
t.Errorf("Expected Products to have length of 1 but was %d", len(organization.Products))
}
if organization.Products[0] != 110 {
t.Errorf("Expected first Product to be %d but was %d", 110, organization.Products[0])
}
}

func TestGetBoardsInOrganization(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions testdata/organizations/culturefoundry.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"url": "https://trello.com/culturefoundry",
"website": null,
"logoHash": null,
"products": [],
"powerUps": []
"products": [110],
"powerUps": [42]
}