Refresh dashboard list after bulk delete (#12945)

This commit is contained in:
Michael S. Molina 2021-02-08 21:49:23 -03:00 committed by GitHub
parent dd0af74019
commit d5e6190998
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 0 deletions

View File

@ -47,4 +47,15 @@ describe('chart list view', () => {
.find('[data-test="cell-text"]')
.contains('Location of Current Developers');
});
it('should bulk delete correctly', () => {
cy.get('[data-test="listview-table"]').should('be.visible');
cy.get('[data-test="bulk-select"]').eq(0).click();
cy.get('[data-test="checkbox-off"]').eq(1).click();
cy.get('[data-test="checkbox-off"]').eq(2).click();
cy.get('[data-test="bulk-select-action"]').eq(0).click();
cy.get('[data-test="delete-modal-input"]').eq(0).type('DELETE');
cy.get('[data-test="modal-confirm-button"]').eq(0).click();
cy.get('[data-test="checkbox-on"]').should('not.exist');
});
});

View File

@ -47,4 +47,15 @@ describe('dashboard list view', () => {
.find('[data-test="cell-text"]')
.contains("World Bank's Data");
});
it('should bulk delete correctly', () => {
cy.get('[data-test="listview-table"]').should('be.visible');
cy.get('[data-test="bulk-select"]').eq(0).click();
cy.get('[data-test="checkbox-off"]').eq(1).click();
cy.get('[data-test="checkbox-off"]').eq(2).click();
cy.get('[data-test="bulk-select-action"]').eq(0).click();
cy.get('[data-test="delete-modal-input"]').eq(0).type('DELETE');
cy.get('[data-test="modal-confirm-button"]').eq(0).click();
cy.get('[data-test="checkbox-on"]').should('not.exist');
});
});

View File

@ -516,6 +516,7 @@ function ChartList(props: ChartListProps) {
subMenuButtons.push({
name: t('Bulk select'),
buttonStyle: 'secondary',
'data-test': 'bulk-select',
onClick: toggleBulkSelect,
});
}

View File

@ -169,6 +169,7 @@ function DashboardList(props: DashboardListProps) {
)}`,
}).then(
({ json = {} }) => {
refreshData();
addSuccessToast(json.message);
},
createErrorHandler(errMsg =>
@ -471,6 +472,7 @@ function DashboardList(props: DashboardListProps) {
subMenuButtons.push({
name: t('Bulk select'),
buttonStyle: 'secondary',
'data-test': 'bulk-select',
onClick: toggleBulkSelect,
});
}