show edit modal on dashboards list view (#9211)

* show edit modal on dashboards list view

* lint

* fix test

* simplify PropertiesModal interface

* lint

* comply with method ordering

* fix type issue
This commit is contained in:
David Aaron Suddjian
2020-03-19 08:05:35 -07:00
committed by GitHub
parent d7ea41a529
commit 46598830e9
6 changed files with 158 additions and 67 deletions

View File

@@ -24,6 +24,7 @@ import fetchMock from 'fetch-mock';
import DashboardList from 'src/views/dashboardList/DashboardList';
import ListView from 'src/components/ListView/ListView';
import PropertiesModal from 'src/dashboard/components/PropertiesModal';
// store needed for withToasts(DashboardTable)
const mockStore = configureStore([thunk]);
@@ -93,4 +94,13 @@ describe('DashboardList', () => {
`"/http//localhost/api/v1/dashboard/?q={%22order_column%22:%22changed_on%22,%22order_direction%22:%22desc%22,%22page%22:0,%22page_size%22:25}"`,
);
});
it('edits', async () => {
expect(wrapper.find(PropertiesModal)).toHaveLength(0);
wrapper
.find('.fa-pencil')
.first()
.simulate('click');
expect(wrapper.find(PropertiesModal)).toHaveLength(1);
});
});