File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -411,7 +411,7 @@ describe("Test Service", () => {
411411 expect ( await svc . prepareContextParams ( params ) ) . toEqual ( { a : 5 } ) ;
412412 } ) ;
413413
414- it ( "should return the context params" , async ( ) => {
414+ it ( "should return the modified params" , async ( ) => {
415415 svc . prepareContextParams = jest . fn ( params => {
416416 return {
417417 ...params ,
@@ -428,6 +428,19 @@ describe("Test Service", () => {
428428 expect ( svc . prepareContextParams ) . toBeCalledTimes ( 1 ) ;
429429 expect ( svc . prepareContextParams ) . toBeCalledWith ( params ) ;
430430 } ) ;
431+
432+ it ( "should return the unwrapped params" , async ( ) => {
433+ svc . prepareContextParams = jest . fn ( async params => params . input ) ;
434+
435+ const params = {
436+ input : { a : 5 } ,
437+ } ;
438+
439+ expect ( await svc . prepareContextParams ( params ) ) . toEqual ( { a : 5 } ) ;
440+
441+ expect ( svc . prepareContextParams ) . toBeCalledTimes ( 1 ) ;
442+ expect ( svc . prepareContextParams ) . toBeCalledWith ( params ) ;
443+ } ) ;
431444 } ) ;
432445
433446 describe ( "Test 'createServiceResolvers'" , ( ) => {
You can’t perform that action at this time.
0 commit comments