Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
timleslie committed Feb 19, 2021
1 parent 72ac50f commit f116066
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/api-tests/relationships/shared-names.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ const { Text, Relationship } = require('@keystonejs/fields');
const { multiAdapterRunners, setupServer } = require('@keystonejs/test-utils');
const { createItems, updateItems } = require('@keystonejs/server-side-graphql-client');

const createInitialData = async context => {
const createInitialData = async keystone => {
const roles = await createItems({
context,
keystone,
listKey: 'Role',
items: [{ data: { name: 'RoleA' } }, { data: { name: 'RoleB' } }, { data: { name: 'RoleC' } }],
returnFields: 'id name',
});
const companies = await createItems({
context,
keystone,
listKey: 'Company',
items: [
{ data: { name: 'CompanyA' } },
Expand All @@ -20,7 +20,7 @@ const createInitialData = async context => {
returnFields: 'id name',
});
const employees = await createItems({
context,
keystone,
listKey: 'Employee',
items: [
{
Expand Down Expand Up @@ -48,7 +48,7 @@ const createInitialData = async context => {
returnFields: 'id name',
});
await createItems({
context,
keystone,
listKey: 'Location',
items: [
{
Expand Down Expand Up @@ -85,7 +85,7 @@ const createInitialData = async context => {
returnFields: 'id name',
});
await updateItems({
context,
keystone,
listKey: 'Role',
items: [
{
Expand Down Expand Up @@ -150,9 +150,9 @@ multiAdapterRunners().map(({ runner, adapterName }) =>
describe(`Adapter: ${adapterName}`, () => {
test(
'Query',
runner(setupKeystone, async ({ context }) => {
await createInitialData(context);
const { data, errors } = await context.executeGraphQL({
runner(setupKeystone, async ({ keystone }) => {
await createInitialData(keystone);
const { data, errors } = await keystone.executeGraphQL({
query: `{
allEmployees(where: {
company: { employees_some: { role: { name: "RoleA" } } }
Expand Down

0 comments on commit f116066

Please sign in to comment.