Add missing msg-att test for store
This commit is contained in:
36
store/tests/messaging_message_attachments_test.go
Normal file
36
store/tests/messaging_message_attachments_test.go
Normal 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))
|
||||
})
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user