Prettify the frontend code (#8648)

* Add Prettier global configs

* Format js/jsx/ts/tsx/less files
This commit is contained in:
Erik Ritter
2019-11-27 14:02:48 -08:00
committed by GitHub
parent e21f768a92
commit 44d919c757
398 changed files with 8700 additions and 6117 deletions

View File

@@ -16,14 +16,17 @@
* specific language governing permissions and limitations
* under the License.
*/
import { emptyQueryResults, clearQueryEditors } from '../../../../src/SqlLab/utils/reduxStateToLocalStorageHelper';
import {
emptyQueryResults,
clearQueryEditors,
} from '../../../../src/SqlLab/utils/reduxStateToLocalStorageHelper';
import { LOCALSTORAGE_MAX_QUERY_AGE_MS } from '../../../../src/SqlLab/constants';
import { queries, defaultQueryEditor } from '../fixtures';
describe('reduxStateToLocalStorageHelper', () => {
const queriesObj = {};
beforeEach(() => {
queries.forEach((q) => {
queries.forEach(q => {
queriesObj[q.id] = q;
});
});
@@ -32,7 +35,9 @@ describe('reduxStateToLocalStorageHelper', () => {
// make sure sample data contains old query
const oldQuery = queries[0];
const { id, startDttm } = oldQuery;
expect(Date.now() - startDttm).toBeGreaterThan(LOCALSTORAGE_MAX_QUERY_AGE_MS);
expect(Date.now() - startDttm).toBeGreaterThan(
LOCALSTORAGE_MAX_QUERY_AGE_MS,
);
expect(Object.keys(oldQuery.results)).toContain('data');
const emptiedQuery = emptyQueryResults(queriesObj);