impress-2020/src/server/query-tests/SpeciesColorPair.test.js

32 lines
655 B
JavaScript
Raw Normal View History

const gql = require("graphql-tag");
const { query, getDbCalls } = require("./setup.js");
describe("SpeciesColorPair", () => {
it("gets them all", async () => {
const res = await query({
query: gql`
query {
allValidSpeciesColorPairs {
color {
id
}
species {
id
}
}
}
`,
});
expect(res).toHaveNoErrors();
expect(res.data).toMatchSnapshot();
expect(getDbCalls()).toMatchInlineSnapshot(`
Array [
Array [
"SELECT species_id, color_id FROM pet_types",
],
]
`);
});
});