snapshot of https://github.com/traggo/server.git (master, 2026-09-16; blobs > 131072B omitted)
Some checks failed
build / build (push) Failing after 3s

This commit is contained in:
upstream-mirror
2026-09-16 05:24:45 +05:00
commit cda7c1a474
272 changed files with 31973 additions and 0 deletions

23
timespan/utils_test.go Normal file
View File

@@ -0,0 +1,23 @@
package timespan
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/traggo/server/model"
"github.com/traggo/server/test"
)
func assertTimeSpanExist(t *testing.T, db *test.Database, expected model.TimeSpan) {
found := new(model.TimeSpan)
find := db.Preload("Tags").Where("user_id = ?", expected.UserID).Where("id = ?", expected.ID).Find(found)
require.Nil(t, find.Error)
require.NotNil(t, found)
require.Equal(t, expected, *found)
}
func assertTimeSpanCount(t *testing.T, db *test.Database, expected int) {
count := new(int)
db.Model(new(model.TimeSpan)).Count(count)
require.Equal(t, expected, *count)
}