justinpark commented on code in PR #21937:
URL: https://github.com/apache/superset/pull/21937#discussion_r1005189792
##########
superset-frontend/packages/superset-ui-core/test/connection/callApi/parseResponse.test.ts:
##########
@@ -137,6 +137,17 @@ describe('parseResponse()', () => {
expect(responseRaw.bodyUsed).toBe(false);
});
+ it('resolves to big number value if `parseMethod=json-bigint`', async () => {
+ const mockBigIntUrl = '/mock/get/bigInt';
+ const mockGetBigIntPayload = '{ "value": 9223372036854775807 }';
+ fetchMock.get(mockBigIntUrl, mockGetBigIntPayload);
+ const responseBigNumber = await parseResponse(
+ callApi({ url: mockBigIntUrl, method: 'GET' }),
+ 'json-bigint',
+ );
+ expect(`${responseBigNumber.json.value}`).toEqual('9223372036854775807');
+ });
Review Comment:
@zhaoyongjie good point. I added the spec for negative number.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]