Skip to content

Commit

Permalink
Remove tests that are no longer relevant
Browse files Browse the repository at this point in the history
  • Loading branch information
dylan-apollo committed May 24, 2024
1 parent 2a8ab7a commit 8aa8d01
Showing 1 changed file with 0 additions and 63 deletions.
63 changes: 0 additions & 63 deletions composition-js/src/__tests__/connectors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,67 +294,4 @@ describe("connect spec and join__directive", () => {
expect(error.message).toEqual('[with-connectors] Directive "@connect" argument "http" of type "connect__ConnectHTTP!" is required, but it was not provided.');
expect(error.extensions.code).toEqual("INVALID_GRAPHQL");
})

it("validates the baseURL argument for sources", () => {
const subgraphs = [
{
name: "with-connectors",
typeDefs: parse(`
extend schema
@link(
url: "https://specs.apollo.dev/federation/v2.7"
import: ["@key"]
)
@link(
url: "https://specs.apollo.dev/connect/v0.1"
import: ["@connect", "@source"]
)
@source(name: "v1", http: {baseURL: "127.0.0.1"})
type Query {
resources: [String!]!
@connect(source: "v1", http: {GET: "/resources"})
}
`),
},
];

const result = composeServices(subgraphs);
expect(result.errors?.length).toBe(1);
const error = result.errors![0];
expect(error.message).toEqual('[with-connectors] baseURL argument for @source \"v1\" was not a valid URL: relative URL without a base');
expect(error.extensions.code).toEqual("SOURCE_URL_INVALID");
expect(error.locations).toBeDefined()
})

it("includes locations for renamed directives", () => {
const subgraphs = [
{
name: "with-connectors",
typeDefs: parse(`
extend schema
@link(
url: "https://specs.apollo.dev/federation/v2.7"
)
@link(
url: "https://specs.apollo.dev/connect/v0.1"
import: [{name: "@source", as: "@api"}, "@connect"]
)
@api(name: "v1", http: {baseURL: "127.0.0.1"})
type Query {
resources: [String!]!
@connect(source: "v1", http: {GET: "/resources"})
}
`),
},
];

const result = composeServices(subgraphs);
expect(result.errors?.length).toBe(1);
const error = result.errors![0];
expect(error.message).toEqual('[with-connectors] baseURL argument for @api \"v1\" was not a valid URL: relative URL without a base');
expect(error.extensions.code).toEqual("SOURCE_URL_INVALID");
expect(error.locations).toBeDefined()
})
});

0 comments on commit 8aa8d01

Please sign in to comment.