Skip to content

Commit

Permalink
More test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Apr 6, 2020
1 parent 50b24b4 commit 01c829d
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 26 deletions.
8 changes: 4 additions & 4 deletions api-tests/queries/limits.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ multiAdapterRunners().map(({ runner, adapterName }) =>
query {
allUsers(
where: { name_contains: "J" },
orderBy: "name_ASC",
sortBy: name_ASC,
) {
name
}
Expand Down Expand Up @@ -232,10 +232,10 @@ multiAdapterRunners().map(({ runner, adapterName }) =>
{ title: "Two authors" },
]
}
orderBy: "title_ASC",
sortBy: title_ASC,
) {
title
author(orderBy: "name_ASC") {
author(sortBy: name_ASC) {
name
}
}
Expand Down Expand Up @@ -319,7 +319,7 @@ multiAdapterRunners().map(({ runner, adapterName }) =>
title
author {
posts {
title
title
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions api-tests/queries/relationships.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ multiAdapterRunners().map(({ runner, adapterName }) =>
feed_some: { title_contains: "J" }
}) {
id
feed(orderBy: "title_ASC") {
feed(sortBy: title_ASC) {
title
}
}
Expand Down Expand Up @@ -299,7 +299,7 @@ multiAdapterRunners().map(({ runner, adapterName }) =>
}) {
id
name
feed(orderBy: "title_ASC") {
feed(sortBy: title_ASC) {
id
title
}
Expand Down Expand Up @@ -331,7 +331,7 @@ multiAdapterRunners().map(({ runner, adapterName }) =>
allUsers(where: {
feed_none: { title_contains: "J" }
},
orderBy: "id_ASC") {
sortBy: id_ASC) {
id
feed {
title
Expand Down
2 changes: 1 addition & 1 deletion api-tests/relationships/filtering/nested.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ multiAdapterRunners().map(({ runner, adapterName }) =>
query {
allUsers {
id
posts (first: 1, orderBy: "content_ASC") {
posts (first: 1, sortBy: content_ASC) {
id
content
}
Expand Down
6 changes: 3 additions & 3 deletions api-tests/relationships/nested-mutations/create-many.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ multiAdapterRunners().map(({ runner, adapterName }) =>
notes: { create: [{ content: "${noteContent}" }] }
}) {
id
notes(orderBy: "content_ASC") {
notes(sortBy: content_ASC) {
id
content
}
Expand Down Expand Up @@ -118,7 +118,7 @@ multiAdapterRunners().map(({ runner, adapterName }) =>
}
}) {
id
notes(orderBy: "content_ASC") {
notes(sortBy: content_ASC) {
id
content
}
Expand Down Expand Up @@ -245,7 +245,7 @@ multiAdapterRunners().map(({ runner, adapterName }) =>
}
) {
id
notes(orderBy: "content_ASC") {
notes(sortBy: content_ASC) {
id
content
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ multiAdapterRunners().map(({ runner, adapterName }) =>
notes: { connect: [{ id: "${noteA.id}" }, { id: "${noteB.id}" }] }
}) {
id
notes(orderBy: "title_ASC") { id title }
notes(sortBy: title_ASC) { id title }
}
}
`,
Expand All @@ -60,7 +60,7 @@ multiAdapterRunners().map(({ runner, adapterName }) =>
notes: { connect: [{ id: "${noteC.id}" }, { id: "${noteD.id}" }] }
}) {
id
notes(orderBy: "title_ASC") { id title }
notes(sortBy: title_ASC) { id title }
}
}
`,
Expand All @@ -82,7 +82,7 @@ multiAdapterRunners().map(({ runner, adapterName }) =>
notes: { connect: [{ id: "${noteB.id}" }] }
}) {
id
notes(orderBy: "title_ASC") { id title }
notes(sortBy: title_ASC) { id title }
}
}
`,
Expand Down Expand Up @@ -119,7 +119,7 @@ multiAdapterRunners().map(({ runner, adapterName }) =>
{
User(where: { id: "${alice.createUser.id}"}) {
id
notes(orderBy: "title_ASC") { id title }
notes(sortBy: title_ASC) { id title }
}
}
`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ multiAdapterRunners().map(({ runner, adapterName }) =>
}
) {
id
teachers(orderBy: "id_ASC") {
teachers(sortBy: id_ASC) {
id
}
}
Expand Down
6 changes: 3 additions & 3 deletions demo-projects/meetup/site/graphql/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ export const GET_CURRENT_EVENTS = gql`
query GetCurrentEvents($now: DateTime!) {
upcomingEvents: allEvents(
where: { startTime_not: null, status: active, startTime_gte: $now }
orderBy: "startTime_DESC"
sortBy: startTime_DESC
) {
...EventData
}
previousEvents: allEvents(
where: { startTime_not: null, status: active, startTime_lte: $now }
orderBy: "startTime_ASC"
sortBy: startTime_ASC
) {
...EventData
}
Expand All @@ -46,7 +46,7 @@ export const GET_CURRENT_EVENTS = gql`

export const GET_ALL_EVENTS = gql`
{
allEvents(where: { startTime_not: null, status: active }, orderBy: "startTime_DESC") {
allEvents(where: { startTime_not: null, status: active }, sortBy: startTime_DESC) {
...EventData
}
}
Expand Down
8 changes: 4 additions & 4 deletions packages/fields/src/types/DateTime/test-fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,11 @@ export const filterTests = withKeystone => {
);

test(
'Sorting: orderBy: lastOnline_ASC',
'Sorting: sortBy: lastOnline_ASC',
withKeystone(({ keystone, adapterName }) =>
match(
keystone,
'orderBy: "lastOnline_ASC"',
'sortBy: lastOnline_ASC',
adapterName === 'mongoose'
? [
{ name: 'person5', lastOnline: null },
Expand All @@ -225,11 +225,11 @@ export const filterTests = withKeystone => {
);

test(
'Sorting: orderBy: lastOnline_DESC',
'Sorting: sortBy: lastOnline_DESC',
withKeystone(({ keystone, adapterName }) =>
match(
keystone,
'orderBy: "lastOnline_DESC"',
'sortBy: lastOnline_DESC',
adapterName === 'mongoose'
? [
{ name: 'person2', lastOnline: '2000-01-20T00:08:00.000+10:00' },
Expand Down
4 changes: 2 additions & 2 deletions packages/mongo-join-builder/tests/join-builder.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ describe('join builder', () => {
many: true,
uniqueField: 'abc123_posts',
},
postJoinPipeline: [{ $orderBy: 'title' }],
postJoinPipeline: [{ $sortBy: 'title' }],
relationships: [],
excludeFields: [],
},
Expand All @@ -197,7 +197,7 @@ describe('join builder', () => {
pipeline: [
{ $match: { $expr: { $in: ['$_id', '$$tmpVar'] } } },
{ $addFields: { id: '$_id' } },
{ $orderBy: 'title' },
{ $sortBy: 'title' },
],
},
},
Expand Down
2 changes: 1 addition & 1 deletion packages/mongo-join-builder/tests/query-parser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe('query parser', () => {
test('builds a query tree with to-many relationship and other postjoin filters', () => {
const queryTree = queryParser(
{ listAdapter, getUID: jest.fn(key => key) },
{ name: 'foobar', age: 23, $first: 1, posts: { title: 'hello', $orderBy: 'title_ASC' } }
{ name: 'foobar', age: 23, $first: 1, posts: { title: 'hello', $sortBy: 'title_ASC' } }
);

expect(queryTree).toMatchObject({
Expand Down

0 comments on commit 01c829d

Please sign in to comment.