snapshot of https://github.com/traggo/server.git (master, 2026-09-16; blobs > 131072B omitted)
Some checks failed
build / build (push) Failing after 3s
Some checks failed
build / build (push) Failing after 3s
This commit is contained in:
22
graphql/resolver_test.go
Normal file
22
graphql/resolver_test.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package graphql
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/traggo/server/generated/gqlmodel"
|
||||
"github.com/traggo/server/model"
|
||||
"github.com/traggo/server/test"
|
||||
)
|
||||
|
||||
func TestNewResolver_doesNotThrow(t *testing.T) {
|
||||
db := test.InMemoryDB(t)
|
||||
defer db.Close()
|
||||
resolver := NewResolver(db.DB, 4, model.Version{Name: "oops", BuildDate: "date", Commit: "aeu"})
|
||||
resolver.RootMutation()
|
||||
resolver.RootQuery()
|
||||
version, e := resolver.RootQuery().Version(context.Background())
|
||||
assert.NoError(t, e)
|
||||
assert.Equal(t, &gqlmodel.Version{Name: "oops", BuildDate: "date", Commit: "aeu"}, version)
|
||||
}
|
||||
Reference in New Issue
Block a user