rusackas commented on code in PR #39461:
URL: https://github.com/apache/superset/pull/39461#discussion_r3481828964
##########
superset-frontend/src/explore/components/controls/DatasourceControl/DatasourceControl.test.tsx:
##########
@@ -251,25 +265,26 @@ test('Should show SQL Lab for sql_lab role', async () => {
test('Click on Swap dataset option', async () => {
const props = createProps();
- jest
- .spyOn(SupersetClient, 'get')
- .mockImplementation(async ({ endpoint }: { endpoint: string }) => {
+ SupersetClientGet.mockImplementationOnce(
+ async ({ endpoint }: { endpoint: string }) => {
if (endpoint.includes('_info')) {
return {
json: { permissions: ['can_read', 'can_write'] },
} as any;
}
Review Comment:
Fair - swapped both to `as unknown as JsonResponse` so the mock no longer
leans on `any`.
--
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]