mirror of
https://github.com/apache/superset.git
synced 2026-04-24 18:44:53 +00:00
@@ -116,7 +116,7 @@ describe('AlteredSliceTag', () => {
|
||||
let props;
|
||||
|
||||
beforeEach(() => {
|
||||
props = Object.assign({}, defaultProps);
|
||||
props = { ...defaultProps };
|
||||
wrapper = shallow(<AlteredSliceTag {...props} />);
|
||||
});
|
||||
|
||||
@@ -140,8 +140,8 @@ describe('AlteredSliceTag', () => {
|
||||
|
||||
it('sets new diffs when receiving new props', () => {
|
||||
const newProps = {
|
||||
currentFormData: Object.assign({}, props.currentFormData),
|
||||
origFormData: Object.assign({}, props.origFormData),
|
||||
currentFormData: { ...props.currentFormData },
|
||||
origFormData: { ...props.origFormData },
|
||||
};
|
||||
newProps.currentFormData.beta = 10;
|
||||
wrapper = shallow(<AlteredSliceTag {...props} />);
|
||||
|
||||
@@ -30,7 +30,7 @@ describe('Checkbox', () => {
|
||||
|
||||
let wrapper;
|
||||
const factory = o => {
|
||||
const props = Object.assign({}, defaultProps, o);
|
||||
const props = { ...defaultProps, ...o };
|
||||
return shallow(<Checkbox {...props} />);
|
||||
};
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -39,7 +39,7 @@ describe('ColumnOption', () => {
|
||||
const factory = o => <ColumnOption {...o} />;
|
||||
beforeEach(() => {
|
||||
wrapper = shallow(factory(defaultProps));
|
||||
props = Object.assign({}, defaultProps);
|
||||
props = { ...defaultProps };
|
||||
});
|
||||
it('is a valid element', () => {
|
||||
expect(React.isValidElement(<ColumnOption {...defaultProps} />)).toBe(true);
|
||||
|
||||
@@ -40,7 +40,7 @@ describe('MetricOption', () => {
|
||||
const factory = o => <MetricOption {...o} />;
|
||||
beforeEach(() => {
|
||||
wrapper = shallow(factory(defaultProps));
|
||||
props = Object.assign({}, defaultProps);
|
||||
props = { ...defaultProps };
|
||||
});
|
||||
it('is a valid element', () => {
|
||||
expect(React.isValidElement(<MetricOption {...defaultProps} />)).toBe(true);
|
||||
|
||||
@@ -54,9 +54,9 @@ describe('OnPasteSelect', () => {
|
||||
let evt;
|
||||
let expected;
|
||||
beforeEach(() => {
|
||||
props = Object.assign({}, defaultProps);
|
||||
props = { ...defaultProps };
|
||||
wrapper = shallow(<OnPasteSelect {...props} />);
|
||||
evt = Object.assign({}, defaultEvt);
|
||||
evt = { ...defaultEvt };
|
||||
});
|
||||
|
||||
it('renders the supplied selectWrap component', () => {
|
||||
|
||||
@@ -34,7 +34,7 @@ describe('OptionDescription', () => {
|
||||
let props;
|
||||
|
||||
beforeEach(() => {
|
||||
props = { option: Object.assign({}, defaultProps.option) };
|
||||
props = { option: { ...defaultProps.option } };
|
||||
wrapper = shallow(<OptionDescription {...props} />);
|
||||
});
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ describe('PopoverSection', () => {
|
||||
|
||||
let wrapper;
|
||||
const factory = overrideProps => {
|
||||
const props = Object.assign({}, defaultProps, overrideProps || {});
|
||||
const props = { ...defaultProps, ...(overrideProps || {}) };
|
||||
return shallow(<PopoverSection {...props} />);
|
||||
};
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -48,7 +48,7 @@ describe('VirtualizedRendererWrap', () => {
|
||||
let props;
|
||||
beforeEach(() => {
|
||||
wrapper = shallow(<RendererWrap {...defaultProps} />);
|
||||
props = Object.assign({}, defaultProps);
|
||||
props = { ...defaultProps };
|
||||
});
|
||||
|
||||
it('uses the provided renderer', () => {
|
||||
|
||||
@@ -48,7 +48,7 @@ describe('SelectControl', () => {
|
||||
});
|
||||
|
||||
it('renders a AceEditor when language is specified', () => {
|
||||
const props = Object.assign({}, defaultProps);
|
||||
const props = { ...defaultProps };
|
||||
props.language = 'markdown';
|
||||
wrapper = shallow(<TextAreaControl {...props} />);
|
||||
expect(wrapper.find(FormControl)).toHaveLength(0);
|
||||
|
||||
@@ -43,4 +43,4 @@ export const user = {
|
||||
database_access: ['db1', 'db2', 'db3'],
|
||||
},
|
||||
};
|
||||
export const userNoPerms = Object.assign({}, user, { permissions: {} });
|
||||
export const userNoPerms = { ...user, permissions: {} };
|
||||
|
||||
@@ -38,15 +38,9 @@ describe('ResultSet', () => {
|
||||
query: queries[0],
|
||||
height: 0,
|
||||
};
|
||||
const stoppedQueryProps = Object.assign({}, mockedProps, {
|
||||
query: stoppedQuery,
|
||||
});
|
||||
const runningQueryProps = Object.assign({}, mockedProps, {
|
||||
query: runningQuery,
|
||||
});
|
||||
const cachedQueryProps = Object.assign({}, mockedProps, {
|
||||
query: cachedQuery,
|
||||
});
|
||||
const stoppedQueryProps = { ...mockedProps, query: stoppedQuery };
|
||||
const runningQueryProps = { ...mockedProps, query: runningQuery };
|
||||
const cachedQueryProps = { ...mockedProps, query: cachedQuery };
|
||||
const newProps = {
|
||||
query: {
|
||||
cached: false,
|
||||
@@ -94,11 +88,12 @@ describe('ResultSet', () => {
|
||||
});
|
||||
it('should render empty results', () => {
|
||||
const wrapper = shallow(<ResultSet {...mockedProps} />);
|
||||
const emptyResults = Object.assign({}, queries[0], {
|
||||
const emptyResults = {
|
||||
...queries[0],
|
||||
results: {
|
||||
data: [],
|
||||
},
|
||||
});
|
||||
};
|
||||
wrapper.setProps({ query: emptyResults });
|
||||
expect(wrapper.find(FilterableTable)).toHaveLength(0);
|
||||
expect(wrapper.find(Alert)).toHaveLength(1);
|
||||
|
||||
@@ -37,10 +37,7 @@ describe('TabbedSqlEditors', () => {
|
||||
const tabHistory = ['dfsadfs', 'newEditorId'];
|
||||
|
||||
const tables = [
|
||||
Object.assign({}, table, {
|
||||
dataPreviewQueryId: 'B1-VQU1zW',
|
||||
queryEditorId: 'newEditorId',
|
||||
}),
|
||||
{ ...table, dataPreviewQueryId: 'B1-VQU1zW', queryEditorId: 'newEditorId' },
|
||||
];
|
||||
|
||||
const queryEditors = [
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
import sinon from 'sinon';
|
||||
import * as actions from '../../../src/SqlLab/actions/sqlLab';
|
||||
|
||||
export const mockedActions = sinon.stub(Object.assign({}, actions));
|
||||
export const mockedActions = sinon.stub({ ...actions });
|
||||
|
||||
export const alert = { bsStyle: 'danger', msg: 'Ooops', id: 'lksvmcx32' };
|
||||
export const table = {
|
||||
@@ -388,7 +388,7 @@ export const runningQuery = {
|
||||
state: 'running',
|
||||
startDttm: Date.now() - 500,
|
||||
};
|
||||
export const cachedQuery = Object.assign({}, queries[0], { cached: true });
|
||||
export const cachedQuery = { ...queries[0], cached: true };
|
||||
|
||||
export const initialState = {
|
||||
sqlLab: {
|
||||
|
||||
@@ -141,7 +141,7 @@ describe('sqlLabReducer', () => {
|
||||
let newState;
|
||||
let newTable;
|
||||
beforeEach(() => {
|
||||
newTable = Object.assign({}, table);
|
||||
newTable = { ...table };
|
||||
const action = {
|
||||
type: actions.MERGE_TABLE,
|
||||
table: newTable,
|
||||
|
||||
Reference in New Issue
Block a user