2020-04-25 23:03:58 -07:00
|
|
|
const gql = require("graphql-tag");
|
|
|
|
|
const { query, getDbCalls } = require("./setup.js");
|
|
|
|
|
|
|
|
|
|
describe("Pet", () => {
|
|
|
|
|
it("looks up a pet", async () => {
|
|
|
|
|
const res = await query({
|
|
|
|
|
query: gql`
|
|
|
|
|
query {
|
|
|
|
|
petOnNeopetsDotCom(petName: "roopal27") {
|
|
|
|
|
species {
|
|
|
|
|
id
|
2020-05-31 16:00:59 -07:00
|
|
|
name
|
2020-04-25 23:03:58 -07:00
|
|
|
}
|
|
|
|
|
color {
|
|
|
|
|
id
|
2020-05-31 16:00:59 -07:00
|
|
|
name
|
2020-04-25 23:03:58 -07:00
|
|
|
}
|
2020-05-23 13:55:59 -07:00
|
|
|
pose
|
2020-04-25 23:03:58 -07:00
|
|
|
items {
|
|
|
|
|
id
|
2020-07-02 14:33:47 -07:00
|
|
|
name
|
|
|
|
|
description
|
|
|
|
|
thumbnailUrl
|
|
|
|
|
rarityIndex
|
|
|
|
|
isNc
|
2020-04-25 23:03:58 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
`,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
expect(res).toHaveNoErrors();
|
|
|
|
|
expect(res.data).toMatchSnapshot();
|
2020-05-31 16:00:59 -07:00
|
|
|
expect(getDbCalls()).toMatchInlineSnapshot(`
|
|
|
|
|
Array [
|
|
|
|
|
Array [
|
|
|
|
|
"SELECT * FROM species_translations
|
|
|
|
|
WHERE species_id IN (?) AND locale = \\"en\\"",
|
|
|
|
|
Array [
|
|
|
|
|
54,
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
Array [
|
|
|
|
|
"SELECT * FROM color_translations
|
|
|
|
|
WHERE color_id IN (?) AND locale = \\"en\\"",
|
|
|
|
|
Array [
|
|
|
|
|
75,
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
]
|
|
|
|
|
`);
|
2020-04-25 23:03:58 -07:00
|
|
|
});
|
|
|
|
|
});
|