3
0

Add missing msg-att test for store

This commit is contained in:
Denis Arh
2020-09-09 13:10:06 +02:00
parent 24f8457d71
commit 15af5de7c4

View File

@@ -0,0 +1,36 @@
package tests
import (
"context"
"github.com/cortezaproject/corteza-server/messaging/types"
"github.com/cortezaproject/corteza-server/pkg/id"
"github.com/cortezaproject/corteza-server/store"
_ "github.com/joho/godotenv/autoload"
"github.com/stretchr/testify/require"
"testing"
)
func testMessagingMessageAttachments(t *testing.T, s store.MessagingMessageAttachments) {
var (
ctx = context.Background()
)
t.Run("create", func(t *testing.T) {
req := require.New(t)
mma := &types.MessageAttachment{
MessageID: id.Next(),
AttachmentID: id.Next(),
}
req.NoError(s.CreateMessagingMessageAttachment(ctx, mma))
})
t.Run("delete", func(t *testing.T) {
req := require.New(t)
mma := &types.MessageAttachment{
MessageID: id.Next(),
AttachmentID: id.Next(),
}
req.NoError(s.DeleteMessagingMessageAttachment(ctx, mma))
})
}