mirror of
https://github.com/mattermost/focalboard.git
synced 2024-12-24 13:43:12 +02:00
91f9f71bf7
* Replace Block references to use pointers throughout all application layers * lint fixes * gofmt file, lint fix Co-authored-by: Mattermod <mattermod@users.noreply.github.com> Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
34 lines
745 B
Go
34 lines
745 B
Go
package storetests
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/mattermost/focalboard/server/model"
|
|
"github.com/mattermost/focalboard/server/services/store"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func InsertBlocks(t *testing.T, s store.Store, blocks []*model.Block, userID string) {
|
|
for i := range blocks {
|
|
err := s.InsertBlock(blocks[i], userID)
|
|
require.NoError(t, err)
|
|
}
|
|
}
|
|
|
|
func DeleteBlocks(t *testing.T, s store.Store, blocks []*model.Block, modifiedBy string) {
|
|
for _, block := range blocks {
|
|
err := s.DeleteBlock(block.ID, modifiedBy)
|
|
require.NoError(t, err)
|
|
}
|
|
}
|
|
|
|
func ContainsBlockWithID(blocks []*model.Block, blockID string) bool {
|
|
for _, block := range blocks {
|
|
if block.ID == blockID {
|
|
return true
|
|
}
|
|
}
|
|
|
|
return false
|
|
}
|