ids-svc-product/internal/server/cart_freight_test.go

18 lines
504 B
Go

package server
import (
"testing"
"llms.idsbuybuybuy.com/ecommerce/ids-svc-product/internal/repository"
)
func TestCartProductIncludesFreightConfiguration(t *testing.T) {
got := toProtoCartItemProduct("801", repository.CartItemProductRecord{
ProductID: "1001", SKUID: "1101",
Product: &repository.ProductRecord{FreightChargeType: 2, FreightTemplateID: "9001"},
})
if got.GetFreightChargeType() != 2 || got.GetFreightTemplateId() != "9001" {
t.Fatalf("cart product freight = %#v", got)
}
}