Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Migrate gql introspection tests to new framework #1211

Merged
Merged
2,178 changes: 1,111 additions & 1,067 deletions tests/integration/schema/aggregates/inline_array_test.go

Large diffs are not rendered by default.

424 changes: 218 additions & 206 deletions tests/integration/schema/aggregates/simple_test.go

Large diffs are not rendered by default.

396 changes: 204 additions & 192 deletions tests/integration/schema/aggregates/top_level_test.go

Large diffs are not rendered by default.

44 changes: 24 additions & 20 deletions tests/integration/schema/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,40 @@ import (
"testing"

schemaTypes "github.com/sourcenetwork/defradb/request/graphql/schema/types"
testUtils "github.com/sourcenetwork/defradb/tests/integration"
)

// TestIntrospectionExplainTypeDefined tests that the introspection query returns a schema that
// defines the ExplainType enum.
func TestIntrospectionExplainTypeDefined(t *testing.T) {
test := RequestTestCase{
Schema: []string{},
IntrospectionRequest: `
query IntrospectionQuery {
__schema {
types {
kind
name
description
test := testUtils.TestCase{
Actions: []any{
testUtils.IntrospectionRequest{
Request: `
query IntrospectionQuery {
__schema {
types {
kind
name
description
}
}
}
}
}
`,
ContainsData: map[string]any{
"__schema": map[string]any{
"types": []any{
map[string]any{
"description": schemaTypes.ExplainEnum.Description(),
"kind": "ENUM",
"name": "ExplainType",
`,
ContainsData: map[string]any{
"__schema": map[string]any{
"types": []any{
map[string]any{
"description": schemaTypes.ExplainEnum.Description(),
"kind": "ENUM",
"name": "ExplainType",
},
},
},
},
},
},
}

ExecuteRequestTestCase(t, test)
testUtils.ExecuteTestCase(t, []string{}, test)
}
Loading