mirror of
https://github.com/apache/superset.git
synced 2026-04-24 02:25:13 +00:00
feat: filter by me on CRUD list view (#11683)
This commit is contained in:
@@ -36,9 +36,11 @@ const store = mockStore({});
|
||||
|
||||
const chartsInfoEndpoint = 'glob:*/api/v1/chart/_info*';
|
||||
const chartssOwnersEndpoint = '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';
|
||||
const chartsDtasourcesEndpoint = 'glob:*/api/v1/chart/datasources';
|
||||
const chartsDatasourcesEndpoint = 'glob:*/api/v1/chart/datasources';
|
||||
const chartFavoriteStatusEndpoint = 'glob:*/api/v1/chart/favorite_status*';
|
||||
|
||||
const mockCharts = [...new Array(3)].map((_, i) => ({
|
||||
changed_on: new Date().toISOString(),
|
||||
@@ -51,6 +53,10 @@ const mockCharts = [...new Array(3)].map((_, i) => ({
|
||||
thumbnail_url: '/thumbnail',
|
||||
}));
|
||||
|
||||
const mockUser = {
|
||||
userId: 1,
|
||||
};
|
||||
|
||||
fetchMock.get(chartsInfoEndpoint, {
|
||||
permissions: ['can_list', 'can_edit', 'can_delete'],
|
||||
});
|
||||
@@ -58,6 +64,12 @@ fetchMock.get(chartsInfoEndpoint, {
|
||||
fetchMock.get(chartssOwnersEndpoint, {
|
||||
result: [],
|
||||
});
|
||||
fetchMock.get(chartsCreatedByEndpoint, {
|
||||
result: [],
|
||||
});
|
||||
fetchMock.get(chartFavoriteStatusEndpoint, {
|
||||
result: [],
|
||||
});
|
||||
fetchMock.get(chartsEndpoint, {
|
||||
result: mockCharts,
|
||||
chart_count: 3,
|
||||
@@ -68,7 +80,7 @@ fetchMock.get(chartsVizTypesEndpoint, {
|
||||
count: 0,
|
||||
});
|
||||
|
||||
fetchMock.get(chartsDtasourcesEndpoint, {
|
||||
fetchMock.get(chartsDatasourcesEndpoint, {
|
||||
result: [],
|
||||
count: 0,
|
||||
});
|
||||
@@ -85,7 +97,7 @@ describe('ChartList', () => {
|
||||
isFeatureEnabledMock.restore();
|
||||
});
|
||||
const mockedProps = {};
|
||||
const wrapper = mount(<ChartList {...mockedProps} />, {
|
||||
const wrapper = mount(<ChartList {...mockedProps} user={mockUser} />, {
|
||||
context: { store },
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user