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