-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(carto): Add missing 'client' parameter to query requests (#8913)
--------- Co-authored-by: Felix Palmer <[email protected]>
- Loading branch information
1 parent
0870a72
commit d541524
Showing
5 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import {query} from '@deck.gl/carto'; | ||
import test from 'tape-catch'; | ||
import {withMockFetchMapsV3, QUERY_RESPONSE} from '../mock-fetch'; | ||
|
||
test('query', async t => { | ||
await withMockFetchMapsV3(async calls => { | ||
const response = await query({ | ||
connectionName: 'carto_dw', | ||
clientId: 'CUSTOM_CLIENT', | ||
accessToken: '<token>', | ||
sqlQuery: 'SELECT * FROM a.b.h3_table' | ||
}); | ||
|
||
t.is(calls.length, 1, 'calls fetch() x1'); | ||
|
||
const [queryCall] = calls; | ||
|
||
t.match(queryCall.url, /v3\/sql\/carto_dw\/query/, 'connection'); | ||
t.match(queryCall.url, /q=SELECT%20\*%20FROM%20a\.b\.h3_table/, 'query'); | ||
t.match(queryCall.url, /client\=CUSTOM_CLIENT/, 'clientId'); | ||
|
||
t.ok(response, 'returns response'); | ||
t.deepEqual(response, QUERY_RESPONSE, 'correct response'); | ||
}).catch(t.fail); | ||
t.end(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters