Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit 34aeab8

Browse files
committed
Update remaining tests with new coupon format
1 parent 874f0ba commit 34aeab8

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

core/order_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ func TestOpenBazaarNode_CalculateOrderTotal(t *testing.T) {
167167
}
168168
contract.VendorListings[0].Coupons = []*pb.Listing_Coupon{
169169
{
170-
Code: &pb.Listing_Coupon_Hash{Hash: couponHash.B58String()},
171-
Title: "coup",
170+
Code: &pb.Listing_Coupon_Hash{Hash: couponHash.B58String()},
171+
Title: "coup",
172172
Discount: &pb.Listing_Coupon_PercentDiscount{PercentDiscount: 10},
173173
},
174174
}
@@ -198,9 +198,9 @@ func TestOpenBazaarNode_CalculateOrderTotal(t *testing.T) {
198198
}
199199
contract.VendorListings[0].Coupons = []*pb.Listing_Coupon{
200200
{
201-
Code: &pb.Listing_Coupon_Hash{Hash: couponHash.B58String()},
202-
Title: "coup",
203-
Discount: &pb.Listing_Coupon_BigPriceDiscount{ BigPriceDiscount: "6000"},
201+
Code: &pb.Listing_Coupon_Hash{Hash: couponHash.B58String()},
202+
Title: "coup",
203+
Discount: &pb.Listing_Coupon_BigPriceDiscount{BigPriceDiscount: "6000"},
204204
},
205205
}
206206

@@ -452,8 +452,8 @@ func TestOpenBazaarNode_CalculateOrderTotalWithV4Schema(t *testing.T) {
452452
}
453453
v4Contract.VendorListings[0].Coupons = []*pb.Listing_Coupon{
454454
{
455-
Code: &pb.Listing_Coupon_Hash{Hash: couponHash.B58String()},
456-
Title: "coup",
455+
Code: &pb.Listing_Coupon_Hash{Hash: couponHash.B58String()},
456+
Title: "coup",
457457
Discount: &pb.Listing_Coupon_PercentDiscount{PercentDiscount: 10},
458458
},
459459
}
@@ -483,8 +483,8 @@ func TestOpenBazaarNode_CalculateOrderTotalWithV4Schema(t *testing.T) {
483483
}
484484
v4Contract.VendorListings[0].Coupons = []*pb.Listing_Coupon{
485485
{
486-
Code: &pb.Listing_Coupon_Hash{Hash: couponHash.B58String()},
487-
Title: "coup",
486+
Code: &pb.Listing_Coupon_Hash{Hash: couponHash.B58String()},
487+
Title: "coup",
488488
Discount: &pb.Listing_Coupon_BigPriceDiscount{BigPriceDiscount: "6000"},
489489
},
490490
}

repo/listing_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ func TestV4PhysicalGoodDataNormalizesToLatestSchema(t *testing.T) {
248248
},
249249
Coupons: []*pb.Listing_Coupon{
250250
{
251-
PriceDiscount: expectedCouponDiscount,
251+
Discount: &pb.Listing_Coupon_PriceDiscount{PriceDiscount: expectedCouponDiscount},
252252
},
253253
},
254254
}

repo/migrations/Migration027_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func TestUpdateListingHash(t *testing.T) {
3737
// This listing hash is generated using the default IPFS hashing algorithm as of v0.4.19
3838
// If the default hashing algorithm changes at any point in the future you can expect this
3939
// test to fail and it will need to be updated to maintain the functionality of this migration.
40-
expectedListingHash = "QmdnZ4YPNcR7ZxCReTsh5u2fjeD6FQ6w5fiNzJ6db6Q6v6"
40+
expectedListingHash = "Qmdv3oZmVtRuN4tWewsUcBqFYKGD8kaQCq46Yx6rwzEDvH"
4141

4242
listing = factory.NewListing(testListingSlug)
4343
m = jsonpb.Marshaler{

0 commit comments

Comments
 (0)