Skip to content

Commit

Permalink
Add testing for complexe graphql queries
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
  • Loading branch information
alexandrebodin committed Oct 15, 2020
1 parent 2633305 commit e28f5da
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions packages/strapi-plugin-graphql/test/graphqlCrud.test.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,49 @@ describe('Test Graphql API End to End', () => {
},
[postsPayload[0]],
],
[
{
_or: [{ name_in: ['post 2'] }, { bigint_eq: 1316130638171 }],
},
[postsPayload[0], postsPayload[1]],
],
[
{
_where: { nullable_null: false },
},
[postsPayload[0]],
],
[
{
_where: { _or: { nullable_null: false } },
},
[postsPayload[0]],
],
[
{
_where: [{ nullable_null: false }],
},
[postsPayload[0]],
],
[
{
_where: [{ _or: [{ name_in: ['post 2'] }, { bigint_eq: 1316130638171 }] }],
},
[postsPayload[0], postsPayload[1]],
],
[
{
_where: [
{
_or: [
{ name_in: ['post 2'] },
{ _or: [{ bigint_eq: 1316130638171 }, { nullable_null: false }] },
],
},
],
},
[postsPayload[0], postsPayload[1]],
],
])('List posts with where clause %o', async (where, expected) => {
const res = await graphqlQuery({
query: /* GraphQL */ `
Expand Down

0 comments on commit e28f5da

Please sign in to comment.