File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -1164,14 +1164,15 @@ describe('OAuth Authorization', () => {
11641164 href : 'https://auth.example.com/token'
11651165 } ) ,
11661166 expect . objectContaining ( {
1167- method : 'POST' ,
1168- headers : new Headers ( {
1169- 'Content-Type' : 'application/x-www-form-urlencoded'
1170- } )
1171- } )
1167+ method : 'POST'
1168+ } ) ,
11721169 ) ;
11731170
1174- const body = mockFetch . mock . calls [ 0 ] [ 1 ] . body as URLSearchParams ;
1171+ const options = mockFetch . mock . calls [ 0 ] [ 1 ] ;
1172+ expect ( options . headers ) . toBeInstanceOf ( Headers ) ;
1173+ expect ( options . headers . get ( 'Content-Type' ) ) . toBe ( 'application/x-www-form-urlencoded' ) ;
1174+
1175+ const body = options . body as URLSearchParams ;
11751176 expect ( body . get ( 'grant_type' ) ) . toBe ( 'authorization_code' ) ;
11761177 expect ( body . get ( 'code' ) ) . toBe ( 'code123' ) ;
11771178 expect ( body . get ( 'code_verifier' ) ) . toBe ( 'verifier123' ) ;
You can’t perform that action at this time.
0 commit comments