mirror of
https://github.com/apache/superset.git
synced 2026-04-12 20:57:55 +00:00
[dashboard] New, list view (react) (#8845)
* adds dashboard listview component * use new api * use json over rison * lint * adds seperate dashboard list view * edit and delete actions * fix lint ignore * fix common_bootstrap_payload is now a function * fix license * fix pylint * isort * fix tests * lint * lint ts * fix js tests * fix double import from bad rebase * fix indent error * lookup permissions * generic permission lookup * get tslint to pass * adds js specs * lint * fix rebase * lint * lint again * fix type errors preventing build * adds more specs * fix tslint error * fix null check * remove unecessary code * use translations provided by api * more translations * linting * fix spec * i18n * fix register order
This commit is contained in:
@@ -21,16 +21,16 @@ import { mount } from 'enzyme';
|
||||
import thunk from 'redux-thunk';
|
||||
import configureStore from 'redux-mock-store';
|
||||
import fetchMock from 'fetch-mock';
|
||||
import { Table } from 'reactable-arc';
|
||||
|
||||
import ListView from 'src/components/ListView/ListView';
|
||||
import DashboardTable from '../../../src/welcome/DashboardTable';
|
||||
import Loading from '../../../src/components/Loading';
|
||||
|
||||
// store needed for withToasts(TableLoader)
|
||||
// store needed for withToasts(DashboardTable)
|
||||
const mockStore = configureStore([thunk]);
|
||||
const store = mockStore({});
|
||||
|
||||
const dashboardsEndpoint = 'glob:*/dashboardasync/api/read*';
|
||||
const dashboardsEndpoint = 'glob:*/api/v1/dashboard/*';
|
||||
const mockDashboards = [{ id: 1, url: 'url', dashboard_title: 'title' }];
|
||||
|
||||
fetchMock.get(dashboardsEndpoint, { result: mockDashboards });
|
||||
@@ -48,7 +48,7 @@ describe('DashboardTable', () => {
|
||||
expect(wrapper.find(Loading)).toHaveLength(1);
|
||||
});
|
||||
|
||||
it('fetches dashboards and renders a Table', done => {
|
||||
it('fetches dashboards and renders a ListView', done => {
|
||||
const wrapper = setup();
|
||||
|
||||
setTimeout(() => {
|
||||
@@ -56,7 +56,7 @@ describe('DashboardTable', () => {
|
||||
// there's a delay between response and updating state, so manually set it
|
||||
// rather than adding a timeout which could introduce flakiness
|
||||
wrapper.setState({ dashaboards: mockDashboards });
|
||||
expect(wrapper.find(Table)).toHaveLength(1);
|
||||
expect(wrapper.find(ListView)).toHaveLength(1);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user