more features
All checks were successful
Build and Publish / BuildAndDeployAmd64 (push) Successful in 29s
Build and Publish / BuildAndDeploy (push) Successful in 2m23s

This commit is contained in:
matst80
2024-11-14 19:33:04 +01:00
parent d617fd9657
commit 3f6f78c839
5 changed files with 156 additions and 62 deletions

View File

@@ -67,6 +67,25 @@ func TestAddToCartShortCut(t *testing.T) {
}
}
func TestAddRequestToGrain(t *testing.T) {
grain, err := spawn(ToCartId("kalle"))
if err != nil {
t.Errorf("Error spawning: %v\n", err)
}
msg := GetMessage(AddRequestType, &messages.AddRequest{
Quantity: 2,
Sku: "763281",
})
result, err := grain.HandleMessage(msg, false)
if err != nil {
t.Errorf("Error handling message: %v\n", err)
}
if result.StatusCode != 200 {
t.Errorf("Call failed\n")
}
t.Log(result)
}
func TestAddToCart(t *testing.T) {
grain, err := spawn(ToCartId("kalle"))
if err != nil {