mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
[fix] reduce content in sql lab localStorage (#7998)
This commit is contained in:
@@ -16,11 +16,11 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import emptyQueryResults from '../../../../src/SqlLab/utils/emptyQueryResults';
|
||||
import { emptyQueryResults, clearQueryEditors } from '../../../../src/SqlLab/utils/reduxStateToLocalStorageHelper';
|
||||
import { LOCALSTORAGE_MAX_QUERY_AGE_MS } from '../../../../src/SqlLab/constants';
|
||||
import { queries } from '../fixtures';
|
||||
import { queries, defaultQueryEditor } from '../fixtures';
|
||||
|
||||
describe('emptyQueryResults', () => {
|
||||
describe('reduxStateToLocalStorageHelper', () => {
|
||||
const queriesObj = {};
|
||||
beforeEach(() => {
|
||||
queries.forEach((q) => {
|
||||
@@ -39,4 +39,12 @@ describe('emptyQueryResults', () => {
|
||||
expect(emptiedQuery[id].startDttm).toBe(startDttm);
|
||||
expect(emptiedQuery[id].results).toEqual({});
|
||||
});
|
||||
|
||||
it('should only return selected keys for query editor', () => {
|
||||
const queryEditors = [defaultQueryEditor];
|
||||
expect(Object.keys(queryEditors[0])).toContain('schemaOptions');
|
||||
|
||||
const clearedQueryEditors = clearQueryEditors(queryEditors);
|
||||
expect(Object.keys(clearedQueryEditors)[0]).not.toContain('schemaOptions');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user