From e55c39f97c128ef245d850eff54289959b1f2951 Mon Sep 17 00:00:00 2001 From: clD11 <23483715+clD11@users.noreply.github.com> Date: Wed, 14 Aug 2024 10:38:58 +0100 Subject: [PATCH] fix: rectify skus model tests after rebase --- services/skus/model/model_test.go | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/services/skus/model/model_test.go b/services/skus/model/model_test.go index 59f65eb77..5b9bd97a0 100644 --- a/services/skus/model/model_test.go +++ b/services/skus/model/model_test.go @@ -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 @@ -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 }