Skip to content

Instantly share code, notes, and snippets.

@Samueldhardy
Created October 29, 2018 12:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Samueldhardy/463dbcccbb1fcbff2293a7fc30988a41 to your computer and use it in GitHub Desktop.
Save Samueldhardy/463dbcccbb1fcbff2293a7fc30988a41 to your computer and use it in GitHub Desktop.
cypress/test/test.spec.js
describe('query: GetFoobar()', () => {
const GetFoobar = (foo, bar) => `{
foo(foo: ${foo}, bar: ${bar}) {
id
foobar {
foo
bar
}
}
}`;
const foo = 'foo';
const bar = 'bar';
let responseData;
before(() => {
cy.postGQL(authToken, GetFoobar(foo, bar)).then(
res => (responseData = res.body.data),
);
});
it('returns foobar', () => {
assert.isObject(responseData.foobar);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment