homebox/backend/internal/repo/repo_group_test.go
Hayden 508e2e59bd
tests: improve repo package coverage (#3)
* refactor and add repo tests

* add CI name

* use atomic for test shutdown

* use go 1.19

* add timeout
2022-09-05 00:26:21 -08:00

20 lines
396 B
Go

package repo
import (
"context"
"testing"
"github.com/stretchr/testify/assert"
)
func Test_Group_Create(t *testing.T) {
g, err := tRepos.Groups.Create(context.Background(), "test")
assert.NoError(t, err)
assert.Equal(t, "test", g.Name)
// Get by ID
foundGroup, err := tRepos.Groups.GetOneId(context.Background(), g.ID)
assert.NoError(t, err)
assert.Equal(t, g.ID, foundGroup.ID)
}