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

@@ -19,7 +19,10 @@
import sinon from 'sinon';
import URI from 'urijs';
import { getExploreUrlAndPayload, getExploreLongUrl } from '../../../src/explore/exploreUtils';
import {
getExploreUrlAndPayload,
getExploreLongUrl,
} from '../../../src/explore/exploreUtils';
import * as hostNamesConfig from '../../../src/utils/hostNamesConfig';
describe('exploreUtils', () => {
@@ -44,10 +47,7 @@ describe('exploreUtils', () => {
force: false,
curUrl: 'http://superset.com',
});
compareURI(
URI(url),
URI('/superset/explore/'),
);
compareURI(URI(url), URI('/superset/explore/'));
expect(payload).toEqual(formData);
});
it('generates proper json url', () => {
@@ -57,10 +57,7 @@ describe('exploreUtils', () => {
force: false,
curUrl: 'http://superset.com',
});
compareURI(
URI(url),
URI('/superset/explore_json/'),
);
compareURI(URI(url), URI('/superset/explore_json/'));
expect(payload).toEqual(formData);
});
it('generates proper json forced url', () => {
@@ -72,8 +69,7 @@ describe('exploreUtils', () => {
});
compareURI(
URI(url),
URI('/superset/explore_json/')
.search({ force: 'true' }),
URI('/superset/explore_json/').search({ force: 'true' }),
);
expect(payload).toEqual(formData);
});
@@ -86,8 +82,7 @@ describe('exploreUtils', () => {
});
compareURI(
URI(url),
URI('/superset/explore_json/')
.search({ csv: 'true' }),
URI('/superset/explore_json/').search({ csv: 'true' }),
);
expect(payload).toEqual(formData);
});
@@ -100,8 +95,7 @@ describe('exploreUtils', () => {
});
compareURI(
URI(url),
URI('/superset/explore/')
.search({ standalone: 'true' }),
URI('/superset/explore/').search({ standalone: 'true' }),
);
expect(payload).toEqual(formData);
});
@@ -114,8 +108,7 @@ describe('exploreUtils', () => {
});
compareURI(
URI(url),
URI('/superset/explore_json/')
.search({ foo: 'bar' }),
URI('/superset/explore_json/').search({ foo: 'bar' }),
);
expect(payload).toEqual(formData);
});
@@ -128,8 +121,7 @@ describe('exploreUtils', () => {
});
compareURI(
URI(url),
URI('/superset/explore_json/')
.search({ foo: 'bar' }),
URI('/superset/explore_json/').search({ foo: 'bar' }),
);
expect(payload).toEqual(formData);
});
@@ -142,8 +134,7 @@ describe('exploreUtils', () => {
});
compareURI(
URI(url),
URI('/superset/explore_json/')
.search({ foo: 'bar' }),
URI('/superset/explore_json/').search({ foo: 'bar' }),
);
expect(payload).toEqual(formData);
});
@@ -153,10 +144,14 @@ describe('exploreUtils', () => {
let stub;
const availableDomains = [
'http://localhost/',
'domain1.com', 'domain2.com', 'domain3.com',
'domain1.com',
'domain2.com',
'domain3.com',
];
beforeEach(() => {
stub = sinon.stub(hostNamesConfig, 'availableDomains').value(availableDomains);
stub = sinon
.stub(hostNamesConfig, 'availableDomains')
.value(availableDomains);
});
afterEach(() => {
stub.restore();