mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
add test cases for eta resolver tests
This commit is contained in:
55
test/resolvers/EtaResolverTests.test.ts
Normal file
55
test/resolvers/EtaResolverTests.test.ts
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
import { beforeEach, describe, it } from "@jest/globals";
|
||||||
|
import { ApolloServer } from "@apollo/server";
|
||||||
|
import { UnoptimizedInMemoryRepository } from "../../src/repositories/UnoptimizedInMemoryRepository";
|
||||||
|
import { setUpTestServer } from "../testHelpers/apolloSetupHelpers";
|
||||||
|
import { ServerContext } from "../../src/ServerContext";
|
||||||
|
|
||||||
|
describe("EtaResolvers", () => {
|
||||||
|
let testServer: ApolloServer<ServerContext>;
|
||||||
|
let repository: UnoptimizedInMemoryRepository;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
testServer = setUpTestServer();
|
||||||
|
repository = new UnoptimizedInMemoryRepository();
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("stop", () => {
|
||||||
|
const query = `
|
||||||
|
query GetETAStop($systemId: ID!, $shuttleId: ID!) {
|
||||||
|
system(id: $systemId) {
|
||||||
|
shuttle(id: $shuttleId) {
|
||||||
|
etas {
|
||||||
|
stop {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
it("returns the associated stop if it exists", async () => {
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("shuttle", () => {
|
||||||
|
const query = `
|
||||||
|
query GetETAShuttle($systemId: ID!, $shuttleId: ID!) {
|
||||||
|
system(id: $systemId) {
|
||||||
|
shuttle(id: $shuttleId) {
|
||||||
|
etas {
|
||||||
|
shuttle {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
it("returns the associated shuttle if it exists", async () => {
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user