Skip to content

Commit

Permalink
fix: rectify skus model tests after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
clD11 committed Aug 14, 2024
1 parent 5041e82 commit e55c39f
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions services/skus/model/model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1210,6 +1210,19 @@ func TestOrderItem_StripeItemID(t *testing.T) {
},
exp: tcExpected{val: "stripe_item_id", ok: true},
},
}

for i := range tests {
tc := tests[i]

t.Run(tc.name, func(t *testing.T) {
actual, ok := tc.given.StripeItemID()
should.Equal(t, tc.exp.ok, ok)
should.Equal(t, tc.exp.val, actual)
})
}
}

func TestOrderItemRequestNew_Metadata(t *testing.T) {
type tcGiven struct {
oreq model.OrderItemRequestNew
Expand Down Expand Up @@ -1282,23 +1295,6 @@ func TestOrderItemRequestNew_Metadata(t *testing.T) {
}
}

func mustDecimalFromString(v string) decimal.Decimal {
result, err := decimal.NewFromString(v)
if err != nil {
panic(err)
}

for i := range tests {
tc := tests[i]

t.Run(tc.name, func(t *testing.T) {
actual, ok := tc.given.StripeItemID()
should.Equal(t, tc.exp.ok, ok)
should.Equal(t, tc.exp.val, actual)
})
}
}

func ptrTo[T any](v T) *T {
return &v
}

0 comments on commit e55c39f

Please sign in to comment.