flamingo.me/flamingo-commerce/v3@v3.11.0/test/integrationtest/projecttest/tests/frontend/cart_test.go (about)

     1  //go:build integration
     2  // +build integration
     3  
     4  package frontend_test
     5  
     6  import (
     7  	"testing"
     8  
     9  	"flamingo.me/flamingo-commerce/v3/test/integrationtest"
    10  	"github.com/stretchr/testify/assert"
    11  )
    12  
    13  func Test_Cart_AddToCart(t *testing.T) {
    14  	t.Run("adding simple product", func(t *testing.T) {
    15  		e := integrationtest.NewHTTPExpect(t, "http://"+FlamingoURL)
    16  
    17  		CartAddProduct(t, e, "fake_simple", 5, "", "")
    18  		item := CartGetItems(t, e).MustContain(t, "fake_simple")
    19  
    20  		assert.Equal(t, 5, item.Qty)
    21  	})
    22  
    23  	t.Run("adding configurable product", func(t *testing.T) {
    24  		e := integrationtest.NewHTTPExpect(t, "http://"+FlamingoURL)
    25  
    26  		CartAddProduct(t, e, "fake_configurable", 3, "shirt-red-s", "")
    27  		item := CartGetItems(t, e).MustContain(t, "fake_configurable")
    28  
    29  		assert.Equal(t, 3, item.Qty)
    30  	})
    31  }