Skip to content

Commit 5eadcaf

Browse files
committed
fix test
1 parent 0749160 commit 5eadcaf

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/client/auth.test.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff 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');

0 commit comments

Comments
 (0)