fix(sqllab): rollback clean comments out (#24009)

This commit is contained in:
JUST.in DO IT
2023-05-11 09:41:21 -07:00
committed by GitHub
parent c963416c09
commit 7a55625243
3 changed files with 4 additions and 101 deletions

View File

@@ -308,38 +308,6 @@ describe('async actions', () => {
});
});
describe('runQuery with comments', () => {
const makeRequest = () => {
const request = actions.runQuery({
...query,
sql: `/*
SELECT * FROM
*/
SELECT 213--, {{ds}} "quote out"
/*
{{new_param1}}
{{new_param2}}*/
FROM table
WHERE value = '--"NULL"--' --{{test_param}}`,
});
return request(dispatch, () => initialState);
};
it('makes the fetch request without comments', async () => {
const runQueryEndpoint = 'glob:*/api/v1/sqllab/execute/';
fetchMock.post(runQueryEndpoint, '{}', {
overwriteRoutes: true,
});
await makeRequest().then(() => {
expect(fetchMock.calls(runQueryEndpoint)).toHaveLength(1);
expect(
JSON.parse(fetchMock.calls(runQueryEndpoint)[0][1].body).sql,
).toEqual(`SELECT 213\n\n\nFROM table\nWHERE value = '--"NULL"--'`);
});
});
});
describe('reRunQuery', () => {
let stub;
beforeEach(() => {