mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
feat: sort card view by Alphabetical, Recently Modified, and Least Recently Modified (#10601)
This commit is contained in:
@@ -24,6 +24,7 @@ import fetchMock from 'fetch-mock';
|
||||
import { supersetTheme, ThemeProvider } from '@superset-ui/style';
|
||||
|
||||
import ChartList from 'src/views/CRUD/chart/ChartList';
|
||||
import ConfirmStatusChange from 'src/components/ConfirmStatusChange';
|
||||
import ListView from 'src/components/ListView';
|
||||
import PropertiesModal from 'src/explore/components/PropertiesModal';
|
||||
import ListViewCard from 'src/components/ListViewCard';
|
||||
@@ -49,7 +50,7 @@ const mockCharts = [...new Array(3)].map((_, i) => ({
|
||||
}));
|
||||
|
||||
fetchMock.get(chartsInfoEndpoint, {
|
||||
permissions: ['can_list', 'can_edit'],
|
||||
permissions: ['can_list', 'can_edit', 'can_delete'],
|
||||
});
|
||||
fetchMock.get(chartssOwnersEndpoint, {
|
||||
result: [],
|
||||
@@ -113,4 +114,9 @@ describe('ChartList', () => {
|
||||
wrapper.find('[data-test="pencil"]').first().simulate('click');
|
||||
expect(wrapper.find(PropertiesModal)).toExist();
|
||||
});
|
||||
|
||||
it('delete', () => {
|
||||
wrapper.find('[data-test="trash"]').first().simulate('click');
|
||||
expect(wrapper.find(ConfirmStatusChange)).toExist();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -23,10 +23,11 @@ import configureStore from 'redux-mock-store';
|
||||
import fetchMock from 'fetch-mock';
|
||||
import { supersetTheme, ThemeProvider } from '@superset-ui/style';
|
||||
|
||||
import ConfirmStatusChange from 'src/components/ConfirmStatusChange';
|
||||
import DashboardList from 'src/views/CRUD/dashboard/DashboardList';
|
||||
import ListView from 'src/components/ListView';
|
||||
import PropertiesModal from 'src/dashboard/components/PropertiesModal';
|
||||
import ListViewCard from 'src/components/ListViewCard';
|
||||
import PropertiesModal from 'src/dashboard/components/PropertiesModal';
|
||||
|
||||
// store needed for withToasts(DashboardTable)
|
||||
const mockStore = configureStore([thunk]);
|
||||
@@ -50,7 +51,7 @@ const mockDashboards = [...new Array(3)].map((_, i) => ({
|
||||
}));
|
||||
|
||||
fetchMock.get(dashboardsInfoEndpoint, {
|
||||
permissions: ['can_list', 'can_edit'],
|
||||
permissions: ['can_list', 'can_edit', 'can_delete'],
|
||||
});
|
||||
fetchMock.get(dashboardOwnersEndpoint, {
|
||||
result: [],
|
||||
@@ -104,4 +105,19 @@ describe('DashboardList', () => {
|
||||
wrapper.find('[data-test="pencil"]').first().simulate('click');
|
||||
expect(wrapper.find(PropertiesModal)).toExist();
|
||||
});
|
||||
|
||||
it('card view edits', () => {
|
||||
wrapper.find('[data-test="pencil"]').last().simulate('click');
|
||||
expect(wrapper.find(PropertiesModal)).toExist();
|
||||
});
|
||||
|
||||
it('delete', () => {
|
||||
wrapper.find('[data-test="trash"]').first().simulate('click');
|
||||
expect(wrapper.find(ConfirmStatusChange)).toExist();
|
||||
});
|
||||
|
||||
it('card view delete', () => {
|
||||
wrapper.find('[data-test="trash"]').last().simulate('click');
|
||||
expect(wrapper.find(ConfirmStatusChange)).toExist();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user