@@ -2287,8 +2287,7 @@ describe('ParseGraphQLServer', () => {
2287
2287
expect ( nodeResult . data . node2 . objectId ) . toBe ( obj2 . id ) ;
2288
2288
expect ( nodeResult . data . node2 . someField ) . toBe ( 'some value 2' ) ;
2289
2289
} ) ;
2290
- // TODO: (moumouls, davimacedo) Fix flaky test
2291
- xit ( 'Id inputs should work either with global id or object id' , async ( ) => {
2290
+ it ( 'Id inputs should work either with global id or object id' , async ( ) => {
2292
2291
try {
2293
2292
await apolloClient . mutate ( {
2294
2293
mutation : gql `
@@ -2595,9 +2594,12 @@ describe('ParseGraphQLServer', () => {
2595
2594
. map ( value => value . node . someField )
2596
2595
. sort ( )
2597
2596
) . toEqual ( [ 'some value 22' , 'some value 44' ] ) ;
2598
- expect (
2599
- findSecondaryObjectsResult . data . secondaryObjects . edges [ 0 ] . node . id
2600
- ) . toBeLessThan ( findSecondaryObjectsResult . data . secondaryObjects . edges [ 1 ] . node . id ) ;
2597
+ // NOTE: Here @davimacedo tried to test RelayID order, but the test is wrong since
2598
+ // "objectId1" < "objectId2" do not always keep the order when objectId is transformed
2599
+ // to base64 by Relay
2600
+ // "SecondaryObject:bBRgmzIRRM" < "SecondaryObject:nTMcuVbATY" true
2601
+ // base64("SecondaryObject:bBRgmzIRRM"") < base64(""SecondaryObject:nTMcuVbATY"") false
2602
+ // "U2Vjb25kYXJ5T2JqZWN0OmJCUmdteklSUk0=" < "U2Vjb25kYXJ5T2JqZWN0Om5UTWN1VmJBVFk=" false
2601
2603
expect (
2602
2604
findSecondaryObjectsResult . data . secondaryObjects . edges [ 0 ] . node . objectId
2603
2605
) . toBeLessThan (
@@ -2763,6 +2765,23 @@ describe('ParseGraphQLServer', () => {
2763
2765
handleError ( e ) ;
2764
2766
}
2765
2767
} ) ;
2768
+ it ( 'Id inputs should work either with global id or object id with objectId higher than 19' , async ( ) => {
2769
+ await reconfigureServer ( { objectIdSize : 20 } ) ;
2770
+ const obj = new Parse . Object ( 'SomeClass' ) ;
2771
+ await obj . save ( { name : 'aname' , type : 'robot' } ) ;
2772
+ const result = await apolloClient . query ( {
2773
+ query : gql `
2774
+ query getSomeClass($id: ID!) {
2775
+ someClass(id: $id) {
2776
+ objectId
2777
+ id
2778
+ }
2779
+ }
2780
+ ` ,
2781
+ variables : { id : obj . id } ,
2782
+ } ) ;
2783
+ expect ( result . data . someClass . objectId ) . toEqual ( obj . id ) ;
2784
+ } ) ;
2766
2785
} ) ;
2767
2786
} ) ;
2768
2787
0 commit comments