Skip to content

Commit

Permalink
Merge pull request #95 from kolaente/patch-1
Browse files Browse the repository at this point in the history
fix: change products and powerups type in organization struct
  • Loading branch information
adlio committed Apr 15, 2024
2 parents 609ae2e + 2f5278c commit ca63de6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
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]
}

0 comments on commit ca63de6

Please sign in to comment.