From 912edacb53c6cd9c05436918072896aaf4cf8107 Mon Sep 17 00:00:00 2001 From: Corey Date: Sun, 2 Jan 2022 08:59:00 -0500 Subject: [PATCH] test: make GraphQL server test more reliable (#7758) --- 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 58b26e4b..d204886f 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`