@@ -126,8 +126,10 @@ describe('ParseGraphQLServer', () => {
126126
127127 it ( "should return schema and context with req's info, config and auth" , async ( ) => {
128128 const options = await parseGraphQLServer . _getGraphQLOptions ( ) ;
129- expect ( options . multipart ) . toEqual ( {
130- fileSize : 20971520 ,
129+ expect ( new options . fetchApi . Body ( ) . options ) . toEqual ( {
130+ formDataLimits : {
131+ fileSize : 20971520 ,
132+ } ,
131133 } ) ;
132134 expect ( options . schema ) . toEqual ( parseGraphQLServer . parseGraphQLSchema . graphQLSchema ) ;
133135 const contextResponse = options . context ( { req } ) ;
@@ -6833,7 +6835,7 @@ describe('ParseGraphQLServer', () => {
68336835
68346836 describe ( 'Files Mutations' , ( ) => {
68356837 describe ( 'Create' , ( ) => {
6836- it_only_node_version ( '<17' ) ( 'should return File object' , async ( ) => {
6838+ it ( 'should return File object' , async ( ) => {
68376839 const clientMutationId = uuidv4 ( ) ;
68386840
68396841 parseServer = await global . reconfigureServer ( {
@@ -9299,7 +9301,7 @@ describe('ParseGraphQLServer', () => {
92999301 expect ( result6 [ 0 ] . node . name ) . toEqual ( 'imACountry3' ) ;
93009302 } ) ;
93019303
9302- it_only_node_version ( '<17' ) ( 'should support files' , async ( ) => {
9304+ it ( 'should support files' , async ( ) => {
93039305 try {
93049306 parseServer = await global . reconfigureServer ( {
93059307 publicServerURL : 'http://localhost:13377/parse' ,
@@ -9450,7 +9452,8 @@ describe('ParseGraphQLServer', () => {
94509452 body : body2 ,
94519453 } ) ;
94529454 expect ( res . status ) . toEqual ( 200 ) ;
9453- const result2 = JSON . parse ( await res . text ( ) ) ;
9455+ const resText = await res . text ( ) ;
9456+ const result2 = JSON . parse ( resText ) ;
94549457 expect ( result2 . data . createSomeClass1 . someClass . someField . name ) . toEqual (
94559458 jasmine . stringMatching ( / _ m y F i l e N a m e .t x t $ / )
94569459 ) ;
@@ -9508,7 +9511,6 @@ describe('ParseGraphQLServer', () => {
95089511 id : result2 . data . createSomeClass1 . someClass . id ,
95099512 } ,
95109513 } ) ;
9511-
95129514 expect ( typeof getResult . data . someClass . someField ) . toEqual ( 'object' ) ;
95139515 expect ( getResult . data . someClass . someField . name ) . toEqual (
95149516 result . data . createFile . fileInfo . name
@@ -9547,9 +9549,14 @@ describe('ParseGraphQLServer', () => {
95479549 }
95489550 } ) ;
95499551
9550- it_only_node_version ( '<17' ) ( 'should not upload if file is too large' , async ( ) => {
9552+ it ( 'should not upload if file is too large' , async ( ) => {
95519553 parseGraphQLServer . parseServer . config . maxUploadSize = '1kb' ;
9552-
9554+ const options = await parseGraphQLServer . _getGraphQLOptions ( ) ;
9555+ expect ( new options . fetchApi . Body ( ) . options ) . toEqual ( {
9556+ formDataLimits : {
9557+ fileSize : 1024 ,
9558+ } ,
9559+ } ) ;
95539560 const body = new FormData ( ) ;
95549561 body . append (
95559562 'operations' ,
@@ -9586,9 +9593,8 @@ describe('ParseGraphQLServer', () => {
95869593 headers,
95879594 body,
95889595 } ) ;
9589-
95909596 const result = JSON . parse ( await res . text ( ) ) ;
9591- expect ( res . status ) . toEqual ( 500 ) ;
9597+ expect ( res . status ) . toEqual ( 413 ) ;
95929598 expect ( result . errors [ 0 ] . message ) . toEqual ( 'File size limit exceeded: 1024 bytes' ) ;
95939599 } ) ;
95949600
0 commit comments