mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
[superset-client] replace misc ajax calls (#6135)
* [superset-client][misc] replace ajax calls in DashboardTable, TableLoader, utils, common * [superset-client][misc] replace ajax calls in AsyncSelect, HeaderActions, Deck.gl * [superset-client][misc] fix tests * [superset-client] remove unneeded functional setState calls * [superset-client] make welcome a redux app for toasts * [superset-client] make Profile a redux app for toasts * [superset-client] TableLoader don't pass toast props to dom nodes * tweak deckgl Multi syntax
This commit is contained in:
@@ -1,25 +1,28 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import { shallow } from 'enzyme';
|
||||
import thunk from 'redux-thunk';
|
||||
import configureStore from 'redux-mock-store';
|
||||
|
||||
import { user } from './fixtures';
|
||||
import CreatedContent from '../../../src/profile/components/CreatedContent';
|
||||
import TableLoader from '../../../src/components/TableLoader';
|
||||
|
||||
// store needed for withToasts(TableLoader)
|
||||
const mockStore = configureStore([thunk]);
|
||||
const store = mockStore({});
|
||||
|
||||
describe('CreatedContent', () => {
|
||||
const mockedProps = {
|
||||
user,
|
||||
};
|
||||
it('is valid', () => {
|
||||
expect(
|
||||
React.isValidElement(<CreatedContent {...mockedProps} />),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it('renders 2 TableLoader', () => {
|
||||
const wrapper = mount(<CreatedContent {...mockedProps} />);
|
||||
const wrapper = shallow(<CreatedContent {...mockedProps} />, { context: { store } });
|
||||
expect(wrapper.find(TableLoader)).toHaveLength(2);
|
||||
});
|
||||
|
||||
it('renders 2 titles', () => {
|
||||
const wrapper = mount(<CreatedContent {...mockedProps} />);
|
||||
const wrapper = shallow(<CreatedContent {...mockedProps} />, { context: { store } });
|
||||
expect(wrapper.find('h3')).toHaveLength(2);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user