From 7d10dce3d7081aed39a37afc99935f4a5aef2e75 Mon Sep 17 00:00:00 2001 From: Corey's iMac Date: Sat, 1 Jan 2022 20:03:33 -0500 Subject: [PATCH] refactor: make GraphQL server test more reliable --- spec/ParseGraphQLServer.spec.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/spec/ParseGraphQLServer.spec.js b/spec/ParseGraphQLServer.spec.js index 58b26e4b65..d204886fe5 100644 --- a/spec/ParseGraphQLServer.spec.js +++ b/spec/ParseGraphQLServer.spec.js @@ -2600,11 +2600,19 @@ describe('ParseGraphQLServer', () => { // "SecondaryObject:bBRgmzIRRM" < "SecondaryObject:nTMcuVbATY" true // base64("SecondaryObject:bBRgmzIRRM"") < base64(""SecondaryObject:nTMcuVbATY"") false // "U2Vjb25kYXJ5T2JqZWN0OmJCUmdteklSUk0=" < "U2Vjb25kYXJ5T2JqZWN0Om5UTWN1VmJBVFk=" false + const originalIds = [getSecondaryObjectsResult.data.secondaryObject2.objectId, + getSecondaryObjectsResult.data.secondaryObject4.objectId]; expect( findSecondaryObjectsResult.data.secondaryObjects.edges[0].node.objectId - ).toBeLessThan( + ).not.toBe( findSecondaryObjectsResult.data.secondaryObjects.edges[1].node.objectId ); + expect( + originalIds.includes(findSecondaryObjectsResult.data.secondaryObjects.edges[0].node.objectId) + ).toBeTrue(); + expect( + originalIds.includes(findSecondaryObjectsResult.data.secondaryObjects.edges[1].node.objectId) + ).toBeTrue(); const createPrimaryObjectResult = await apolloClient.mutate({ mutation: gql`