Skip to content

Commit

Permalink
Fix tests for catalog messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Robi9 committed Nov 7, 2023
1 parent 29f51a6 commit b1eba2b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/handlers/msg_catalog_created_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func TestMsgCatalogCreated(t *testing.T) {
SQLAssertions: []handlers.SQLAssertion{
{
SQL: "SELECT COUNT(*) FROM msgs_msg WHERE contact_id = $1 AND metadata = $2 AND high_priority = TRUE",
Args: []interface{}{testdata.Cathy.ID, `{"action":"View Products","body":"Some products","products":["9f526c6f-b2cb-4457-8048-a7f1dc101e50","eb2305cc-bf39-43ad-a069-bbbfb6401acc"]}`},
Args: []interface{}{testdata.Cathy.ID, `{"action":"View Products","body":"Some products","products":["9f526c6f-b2cb-4457-8048-a7f1dc101e50","eb2305cc-bf39-43ad-a069-bbbfb6401acc"],"send_catalog":false}`},
Count: 2,
},
{
Expand Down
5 changes: 2 additions & 3 deletions core/models/catalog_products_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package models_test

import (
"context"
"fmt"
"testing"
"time"

Expand Down Expand Up @@ -37,7 +36,7 @@ func TestCatalogProducts(t *testing.T) {
(uuid, facebook_catalog_id, "name", created_on, modified_on, is_active, channel_id, org_id)
VALUES('9bbe354d-cea6-408b-ba89-9ce28999da3f', '1234567891', 'Catalog Dummy2', now(), now(), false, $1, $2);
`, 123, testdata.Org2.ID)
fmt.Println(err)

assert.NoError(t, err)

ctpn, err := models.GetActiveCatalogFromChannel(ctx, *db, 123)
Expand All @@ -57,5 +56,5 @@ func TestChannelUUIDForChannelID(t *testing.T) {

ctp, err := models.ChannelUUIDForChannelID(ctxp, db, testdata.TwilioChannel.ID)
assert.NoError(t, err)
assert.Equal(t, ctp, testdata.Org2Channel.UUID)
assert.Equal(t, ctp, testdata.TwilioChannel.UUID)
}
Binary file modified mailroom_test.dump
Binary file not shown.
4 changes: 3 additions & 1 deletion services/external/weni/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import (
)

func TestService(t *testing.T) {
_, rt, _, _ := testsuite.Get()
_, rt, db, _ := testsuite.Get()

catalogs.SetDB(db)

defer dates.SetNowSource(dates.DefaultNowSource)
session, _, err := test.CreateTestSession("", envs.RedactionPolicyNone)
Expand Down

0 comments on commit b1eba2b

Please sign in to comment.