api/spec_builder_helper_internal_test.go
Virgil 5c067b3dae refactor(api): normalise config snapshots
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 12:38:54 +00:00

29 lines
620 B
Go

// SPDX-License-Identifier: EUPL-1.2
package api
import "testing"
func TestEngine_SwaggerConfig_Good_NormalisesPathAtSnapshot(t *testing.T) {
e := &Engine{
swaggerPath: " /docs/ ",
}
cfg := e.SwaggerConfig()
if cfg.Path != "/docs" {
t.Fatalf("expected normalised Swagger path /docs, got %q", cfg.Path)
}
}
func TestEngine_TransportConfig_Good_NormalisesGraphQLPathAtSnapshot(t *testing.T) {
e := &Engine{
graphql: &graphqlConfig{
path: " /gql/ ",
},
}
cfg := e.TransportConfig()
if cfg.GraphQLPath != "/gql" {
t.Fatalf("expected normalised GraphQL path /gql, got %q", cfg.GraphQLPath)
}
}