Skip to content

Commit

Permalink
fix(orgs): rename plan 'hobby' -> 'personal'
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmalkmus committed Jul 18, 2023
1 parent a34723a commit e55797e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions axiom/orgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ type Plan uint8
const (
emptyPlan Plan = iota //

Hobby // hobby
Personal // personal
Basic // basic
Team // team
Team // teamMonthly
Enterprise // enterprise
Comped // comped
)
Expand All @@ -32,8 +32,8 @@ func planFromString(s string) (plan Plan, err error) {
switch s {
case emptyPlan.String():
plan = emptyPlan
case Hobby.String():
plan = Hobby
case Personal.String():
plan = Personal
case Basic.String():
plan = Basic
case Team.String():
Expand Down
6 changes: 3 additions & 3 deletions axiom/orgs_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions axiom/orgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,13 @@ func TestOrganizationsService_Get(t *testing.T) {

func TestPlan_Marshal(t *testing.T) {
exp := `{
"plan": "hobby"
"plan": "personal"
}`

b, err := json.Marshal(struct {
Plan Plan `json:"plan"`
}{
Plan: Hobby,
Plan: Personal,
})
require.NoError(t, err)
require.NotEmpty(t, b)
Expand All @@ -214,10 +214,10 @@ func TestPlan_Unmarshal(t *testing.T) {
var act struct {
Plan Plan `json:"plan"`
}
err := json.Unmarshal([]byte(`{ "plan": "hobby" }`), &act)
err := json.Unmarshal([]byte(`{ "plan": "personal" }`), &act)
require.NoError(t, err)

assert.Equal(t, Hobby, act.Plan)
assert.Equal(t, Personal, act.Plan)
}

func TestPlan_String(t *testing.T) {
Expand All @@ -227,15 +227,15 @@ func TestPlan_String(t *testing.T) {
assert.Equal(t, emptyPlan, Plan(0))
assert.Contains(t, (Comped + 1).String(), "Plan(")

for p := Hobby; p <= Comped; p++ {
for p := Personal; p <= Comped; p++ {
s := p.String()
assert.NotEmpty(t, s)
assert.NotContains(t, s, "Plan(")
}
}

func TestPlanFromString(t *testing.T) {
for plan := Hobby; plan <= Comped; plan++ {
for plan := Personal; plan <= Comped; plan++ {
s := plan.String()

parsedPlan, err := planFromString(s)
Expand Down Expand Up @@ -301,7 +301,7 @@ func TestPaymentStatusFromString(t *testing.T) {
func TestLicense(t *testing.T) {
exp := License{
ID: "98baf1f7-0b51-403f-abc1-2ee91972a225",
Plan: Hobby,
Plan: Personal,
MaxUsers: 50,
MaxTeams: 10,
MaxDatasets: 25,
Expand Down

0 comments on commit e55797e

Please sign in to comment.