Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(frontend-tests): Spelling #19853

Merged
merged 24 commits into from
Apr 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ interface QueryString {
native_filters_key: string;
}

xdescribe('nativefiler url param key', () => {
xdescribe('nativefilter url param key', () => {
// const urlParams = { param1: '123', param2: 'abc' };
before(() => {
cy.login();
@@ -36,7 +36,7 @@ xdescribe('nativefiler url param key', () => {
let initialFilterKey: string;
it('should have cachekey in nativefilter param', () => {
// things in `before` will not retry and the `waitForChartLoad` check is
// especically flaky and may need more retries
// especially flaky and may need more retries
cy.visit(WORLD_HEALTH_DASHBOARD);
WORLD_HEALTH_CHARTS.forEach(waitForChartLoad);
cy.wait(1000); // wait for key to be published (debounced)
Original file line number Diff line number Diff line change
@@ -57,8 +57,8 @@ describe('Visualization > Bubble', () => {
});

// Number of circles are pretty unstable when there are a lot of circles
// Since main functionality is already covered in fitler test below,
// skip this test untill we find a solution.
// Since main functionality is already covered in filter test below,
// skip this test until we find a solution.
it.skip('should work', () => {
cy.visitChartByParams(JSON.stringify(BUBBLE_FORM_DATA)).then(() => {
cy.wait('@getJson').then(xhr => {
Original file line number Diff line number Diff line change
@@ -114,7 +114,7 @@ describe('SqlLab query panel', () => {

cy.wait('@sqlLabQuery');

// Save results to check agains below
// Save results to check against below
selectResultsTab().then(resultsA => {
initialResultsTable = resultsA[0];
});
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
import { ChartProps } from '@superset-ui/core';
import transformProps from '../../src/plugin/transformProps';

describe('<%= packageLabel %> tranformProps', () => {
describe('<%= packageLabel %> transformProps', () => {
const formData = {
colorScheme: 'bnbColors',
datasource: '3__table',
@@ -39,7 +39,7 @@ describe('<%= packageLabel %> tranformProps', () => {
}],
});

it('should tranform chart props for viz', () => {
it('should transform chart props for viz', () => {
expect(transformProps(chartProps)).toEqual({
width: 800,
height: 600,
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ import {

describe('NumberFormatterRegistrySingleton', () => {
describe('getNumberFormatterRegistry()', () => {
it('returns a NumberFormatterRegisry', () => {
it('returns a NumberFormatterRegistry', () => {
expect(getNumberFormatterRegistry()).toBeInstanceOf(
NumberFormatterRegistry,
);
Original file line number Diff line number Diff line change
@@ -204,7 +204,7 @@ describe('makeApi()', () => {
expect(result).toBe('ok?');
});

it('should return raw resposnse when responseType=raw', async () => {
it('should return raw response when responseType=raw', async () => {
expect.assertions(2);
const api = makeApi<JsonValue, number, 'raw'>({
method: 'DELETE',
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ import TimeFormatterRegistry from '../../src/time-format/TimeFormatterRegistry';

describe('TimeFormatterRegistrySingleton', () => {
describe('getTimeFormatterRegistry()', () => {
it('returns a TimeFormatterRegisry', () => {
it('returns a TimeFormatterRegistry', () => {
expect(getTimeFormatterRegistry()).toBeInstanceOf(TimeFormatterRegistry);
});
});
Original file line number Diff line number Diff line change
@@ -156,7 +156,7 @@ describe('Translator', () => {
it('throw warning on duplicates', () => {
expect(() => {
addTranslations({
haha: ['this is duplciate'],
haha: ['this is duplicate'],
});
}).toThrow('Duplicate translation key "haha"');
expect(t('haha')).toEqual('Hahaha');
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ import { ChartProps, SqlaFormData } from '@superset-ui/core';
import { EchartsBoxPlotChartProps } from '../../src/BoxPlot/types';
import transformProps from '../../src/BoxPlot/transformProps';

describe('BoxPlot tranformProps', () => {
describe('BoxPlot transformProps', () => {
const formData: SqlaFormData = {
datasource: '5__table',
granularity_sqla: 'ds',
@@ -68,7 +68,7 @@ describe('BoxPlot tranformProps', () => {
],
});

it('should tranform chart props for viz', () => {
it('should transform chart props for viz', () => {
expect(transformProps(chartProps as EchartsBoxPlotChartProps)).toEqual(
expect.objectContaining({
width: 800,
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ import {
EchartsFunnelLabelTypeType,
} from '../../src/Funnel/types';

describe('Funnel tranformProps', () => {
describe('Funnel transformProps', () => {
const formData = {
colorScheme: 'bnbColors',
datasource: '3__table',
@@ -47,7 +47,7 @@ describe('Funnel tranformProps', () => {
],
});

it('should tranform chart props for viz', () => {
it('should transform chart props for viz', () => {
expect(transformProps(chartProps as EchartsFunnelChartProps)).toEqual(
expect.objectContaining({
width: 800,
Original file line number Diff line number Diff line change
@@ -20,8 +20,8 @@ import { ChartProps } from '@superset-ui/core';
import transformProps from '../../src/Graph/transformProps';
import { DEFAULT_GRAPH_SERIES_OPTION } from '../../src/Graph/constants';

describe('EchartsGraph tranformProps', () => {
it('should tranform chart props for viz without category', () => {
describe('EchartsGraph transformProps', () => {
it('should transform chart props for viz without category', () => {
const formData = {
colorScheme: 'bnbColors',
datasource: '3__table',
@@ -149,7 +149,7 @@ describe('EchartsGraph tranformProps', () => {
);
});

it('should tranform chart props for viz with category and falsey normalization', () => {
it('should transform chart props for viz with category and falsey normalization', () => {
const formData = {
colorScheme: 'bnbColors',
datasource: '3__table',
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ import {
import transformProps, { formatPieLabel } from '../../src/Pie/transformProps';
import { EchartsPieChartProps, EchartsPieLabelType } from '../../src/Pie/types';

describe('Pie tranformProps', () => {
describe('Pie transformProps', () => {
const formData: SqlaFormData = {
colorScheme: 'bnbColors',
datasource: '3__table',
@@ -47,7 +47,7 @@ describe('Pie tranformProps', () => {
],
});

it('should tranform chart props for viz', () => {
it('should transform chart props for viz', () => {
expect(transformProps(chartProps as EchartsPieChartProps)).toEqual(
expect.objectContaining({
width: 800,
Original file line number Diff line number Diff line change
@@ -54,7 +54,7 @@ describe('EchartsTimeseries transformProps', () => {
queriesData,
};

it('should tranform chart props for viz', () => {
it('should transform chart props for viz', () => {
const chartProps = new ChartProps(chartPropsConfig);
expect(transformProps(chartProps as EchartsTimeseriesChartProps)).toEqual(
expect.objectContaining({
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
import { ChartProps } from '@superset-ui/core';
import transformProps from '../../src/Tree/transformProps';

describe('EchartsTree tranformProps', () => {
describe('EchartsTree transformProps', () => {
const formData = {
colorScheme: 'bnbColors',
datasource: '3__table',
@@ -35,7 +35,7 @@ describe('EchartsTree tranformProps', () => {
width: 800,
height: 600,
};
it('should tranform when parent present before child', () => {
it('should transform when parent present before child', () => {
const queriesData = [
{
colnames: ['id_column', 'relation_column', 'name_column', 'count'],
@@ -102,7 +102,7 @@ describe('EchartsTree tranformProps', () => {
}),
);
});
it('should tranform when child is present before parent', () => {
it('should transform when child is present before parent', () => {
const queriesData = [
{
colnames: ['id_column', 'relation_column', 'name_column', 'count'],
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ import { ChartProps } from '@superset-ui/core';
import { EchartsTreemapChartProps } from '../../src/Treemap/types';
import transformProps from '../../src/Treemap/transformProps';

describe('Treemap tranformProps', () => {
describe('Treemap transformProps', () => {
const formData = {
colorScheme: 'bnbColors',
datasource: '3__table',
@@ -42,7 +42,7 @@ describe('Treemap tranformProps', () => {
],
});

it('should tranform chart props for viz', () => {
it('should transform chart props for viz', () => {
expect(transformProps(chartProps as EchartsTreemapChartProps)).toEqual(
expect.objectContaining({
width: 800,
Original file line number Diff line number Diff line change
@@ -230,7 +230,7 @@ describe('formatSeriesName', () => {
expect(formatSeriesName(12345678.9, { numberFormatter })).toEqual('12.3M');
});

it('should use default formatting for for date values without formatter', () => {
it('should use default formatting for date values without formatter', () => {
expect(formatSeriesName(new Date('2020-09-11'))).toEqual(
'2020-09-11T00:00:00.000Z',
);
Original file line number Diff line number Diff line change
@@ -67,7 +67,7 @@ describe('plugin-chart-table', () => {
});

describe('TableChart', () => {
let wrap: CommonWrapper; // the ReactDataTable wraper
let wrap: CommonWrapper; // the ReactDataTable wrapper
let tree: Cheerio;

it('render basic data', () => {
@@ -93,7 +93,7 @@ describe('plugin-chart-table', () => {
<TableChart {...transformProps(testData.advanced)} sticky={false} />,
);
tree = wrap.render();
// should successfull rerender with new props
// should successful rerender with new props
const cells = tree.find('td');
expect(tree.find('th').eq(1).text()).toEqual('Sum of Num');
expect(cells.eq(2).text()).toEqual('12.346%');
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@
import { ChartProps } from '@superset-ui/core';
import transformProps from '../../src/legacyPlugin/transformProps';

describe('WordCloud tranformProps', () => {
describe('WordCloud transformProps', () => {
const formData = {
colorScheme: 'bnbColors',
datasource: '3__table',
@@ -42,7 +42,7 @@ describe('WordCloud tranformProps', () => {
],
});

it('should tranform chart props for word cloud viz', () => {
it('should transform chart props for word cloud viz', () => {
expect(transformProps(chartProps)).toEqual({
width: 800,
height: 600,
Original file line number Diff line number Diff line change
@@ -88,7 +88,7 @@ describe('DatasourceEditor', () => {
'Certification details',
);

userEvent.type(await inputLabel, 'test_lable');
userEvent.type(await inputLabel, 'test_label');
userEvent.type(await inputDescription, 'test');
userEvent.type(await inputDtmFormat, 'test');
userEvent.type(await inputCertifiedBy, 'test');
@@ -157,11 +157,11 @@ describe('DatasourceEditor', () => {
const physicalRadioBtn = screen.getByRole('radio', {
name: /physical \(table or view\)/i,
});
const vituralRadioBtn = screen.getByRole('radio', {
const virtualRadioBtn = screen.getByRole('radio', {
name: /virtual \(sql\)/i,
});
expect(physicalRadioBtn).toBeEnabled();
expect(vituralRadioBtn).toBeEnabled();
expect(virtualRadioBtn).toBeEnabled();
});

it('Source Tab: readOnly mode', () => {
@@ -170,11 +170,11 @@ describe('DatasourceEditor', () => {
const physicalRadioBtn = screen.getByRole('radio', {
name: /physical \(table or view\)/i,
});
const vituralRadioBtn = screen.getByRole('radio', {
const virtualRadioBtn = screen.getByRole('radio', {
name: /virtual \(sql\)/i,
});
expect(physicalRadioBtn).toBeDisabled();
expect(vituralRadioBtn).toBeDisabled();
expect(virtualRadioBtn).toBeDisabled();
});
});

Original file line number Diff line number Diff line change
@@ -60,7 +60,7 @@ describe('LabeledErrorBoundInput', () => {
expect(textboxInput).toBeVisible();
expect(errorText).toBeVisible();
});
it('renders a LabledErrorBoundInput with a InfoTooltip', async () => {
it('renders a LabeledErrorBoundInput with a InfoTooltip', async () => {
defaultProps.hasTooltip = true;
render(<LabeledErrorBoundInput {...defaultProps} />);

Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ test('Should send correct props', () => {
);
});

test('Should get correct filds', () => {
test('Should get correct fields', () => {
const props = createProps();
render(<CrossFilterScopingForm {...(props as any)} />);
expect(props.form.getFieldValue).toBeCalledTimes(2);
Original file line number Diff line number Diff line change
@@ -139,7 +139,7 @@ const createProps = () => ({
type CheckboxState = 'checked' | 'unchecked' | 'indeterminate';

/**
* Unfortunatelly react-checkbox-tree doesn't provide an easy way to
* Unfortunately react-checkbox-tree doesn't provide an easy way to
* access the checkbox icon. We need this function to find the element.
*/
function getCheckboxIcon(element: HTMLElement): Element {
@@ -151,7 +151,7 @@ function getCheckboxIcon(element: HTMLElement): Element {
}

/**
* Unfortunatelly when using react-checkbox-tree, the only perceived change of a
* Unfortunately when using react-checkbox-tree, the only perceived change of a
* checkbox state change is the fill color of the SVG icon.
*/
function getCheckboxState(name: string): CheckboxState {
Original file line number Diff line number Diff line change
@@ -141,7 +141,7 @@ test('Should render null empty when "controlItems" are falsy', () => {
expect(container.children).toHaveLength(0);
});

test('Should render render ControlItems', () => {
test('Should render ControlItems', () => {
const props = createProps();

const controlItems = [
@@ -154,7 +154,7 @@ test('Should render render ControlItems', () => {
expect(screen.getAllByRole('checkbox')).toHaveLength(2);
});

test('Clickin on checkbox', () => {
test('Clicking on checkbox', () => {
const props = createProps();
(getControlItems as jest.Mock).mockReturnValue(createControlItems());
const controlItemsMap = getControlItemsMap(props);
@@ -166,7 +166,7 @@ test('Clickin on checkbox', () => {
expect(props.forceUpdate).toBeCalled();
});

test('Clickin on checkbox when resetConfig:flase', () => {
test('Clicking on checkbox when resetConfig:flase', () => {
const props = createProps();
(getControlItems as jest.Mock).mockReturnValue([
{ name: 'name_1', config: { renderTrigger: true, resetConfig: false } },
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@ describe('getDetailedComponentWidth', () => {
).toEqual(empty);
});

it('should match component meta width for resizeable components', () => {
it('should match component meta width for resizable components', () => {
expect(
getDetailedComponentWidth({
component: { id: '', type: types.CHART_TYPE, meta: { width: 1 } },
@@ -76,7 +76,7 @@ describe('getDetailedComponentWidth', () => {
getDetailedComponentWidth({
component: { id: '', type: types.COLUMN_TYPE, meta: { width: 3 } },
}),
// note: occupiedWidth is zero for colunns/see test below
// note: occupiedWidth is zero for columns/see test below
).toEqual({ width: 3, occupiedWidth: 0, minimumWidth: 1 });
});

@@ -217,7 +217,7 @@ describe('getDetailedComponentWidth', () => {
},
},
}),
// occupiedWidth is zero for colunns/see test below
// occupiedWidth is zero for columns/see test below
).toEqual({ width: 12, occupiedWidth: 0, minimumWidth: 7 });
});

Original file line number Diff line number Diff line change
@@ -133,7 +133,7 @@ describe('VerifiedMetricsControl', () => {
multi: defaultProps.multi,
name: defaultProps.name,
// in real life, `onChange` should have been called with the updated
// props (both savedMetrics and value should have beend updated), but
// props (both savedMetrics and value should have been updated), but
// because of the limitation of enzyme (it cannot get props updated from
// useEffect hooks), we are not able to check that here.
savedMetrics: defaultProps.savedMetrics,
4 changes: 2 additions & 2 deletions superset-frontend/src/views/CRUD/chart/ChartList.test.jsx
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ const mockStore = configureStore([thunk]);
const store = mockStore({});

const chartsInfoEndpoint = 'glob:*/api/v1/chart/_info*';
const chartssOwnersEndpoint = 'glob:*/api/v1/chart/related/owners*';
const chartsOwnersEndpoint = 'glob:*/api/v1/chart/related/owners*';
const chartsCreatedByEndpoint = 'glob:*/api/v1/chart/related/created_by*';
const chartsEndpoint = 'glob:*/api/v1/chart/*';
const chartsVizTypesEndpoint = 'glob:*/api/v1/chart/viz_types';
@@ -66,7 +66,7 @@ fetchMock.get(chartsInfoEndpoint, {
permissions: ['can_read', 'can_write'],
});

fetchMock.get(chartssOwnersEndpoint, {
fetchMock.get(chartsOwnersEndpoint, {
result: [],
});
fetchMock.get(chartsCreatedByEndpoint, {
Original file line number Diff line number Diff line change
@@ -148,7 +148,7 @@ describe('DatasetList', () => {
wrapper.find('[data-test="bulk-select-copy"]').text(),
).toMatchInlineSnapshot(`"0 Selected"`);

// Vitual Selected
// Virtual Selected
act(() => {
wrapper.find(IndeterminateCheckbox).at(1).props().onChange(checkedEvent);
});
2 changes: 1 addition & 1 deletion superset-frontend/src/views/CRUD/utils.test.tsx
Original file line number Diff line number Diff line change
@@ -213,7 +213,7 @@ test('successfully modified rison to encode correctly', () => {
});
});

test('checkUploadExtenssions should return valid upload extensions', () => {
test('checkUploadExtensions should return valid upload extensions', () => {
const uploadExtensionTest = ['a', 'b', 'c'];
const randomExtension = ['a', 'c'];
const randomExtensionTwo = ['c'];