mirror of
https://github.com/apache/superset.git
synced 2026-04-18 23:55:00 +00:00
[datasets] new, listview (react) (#9197)
* [datasets] new, react listview * add hidden columns to support filtering by columns not rendered * throw exception if config is incorrect * fix database filter * update endpoints to point to datasets; fix translation strings * move Link into src/components * add add new record button to datasets listview
This commit is contained in:
@@ -30,6 +30,7 @@ const mockStore = configureStore([thunk]);
|
||||
const store = mockStore({});
|
||||
|
||||
const chartsInfoEndpoint = 'glob:*/api/v1/chart/_info*';
|
||||
const chartssOwnersEndpoint = 'glob:*/api/v1/chart/related/owners*';
|
||||
const chartsEndpoint = 'glob:*/api/v1/chart/?*';
|
||||
|
||||
const mockCharts = [...new Array(3)].map((_, i) => ({
|
||||
@@ -43,7 +44,16 @@ const mockCharts = [...new Array(3)].map((_, i) => ({
|
||||
|
||||
fetchMock.get(chartsInfoEndpoint, {
|
||||
permissions: ['can_list', 'can_edit'],
|
||||
filters: [],
|
||||
filters: {
|
||||
slice_name: [],
|
||||
description: [],
|
||||
viz_type: [],
|
||||
datasource_name: [],
|
||||
owners: [],
|
||||
},
|
||||
});
|
||||
fetchMock.get(chartssOwnersEndpoint, {
|
||||
result: [],
|
||||
});
|
||||
fetchMock.get(chartsEndpoint, {
|
||||
result: mockCharts,
|
||||
@@ -69,6 +79,11 @@ describe('ChartList', () => {
|
||||
expect(callsI).toHaveLength(1);
|
||||
});
|
||||
|
||||
it('fetches owners', () => {
|
||||
const callsO = fetchMock.calls(/chart\/related\/owners/);
|
||||
expect(callsO).toHaveLength(1);
|
||||
});
|
||||
|
||||
it('fetches data', () => {
|
||||
wrapper.update();
|
||||
const callsD = fetchMock.calls(/chart\/\?q/);
|
||||
|
||||
Reference in New Issue
Block a user