Created DeleteTagConfirmModal test

This commit is contained in:
Alejandro Celaya
2019-01-13 23:26:06 +01:00
parent 056286636d
commit 11d49fb70f
3 changed files with 92 additions and 6 deletions

View File

@@ -13,13 +13,12 @@ export default class DeleteTagConfirmModal extends React.Component {
tagDeleted: PropTypes.func,
};
doDelete = () => {
doDelete = async () => {
const { tag, toggle, deleteTag } = this.props;
return deleteTag(tag).then(() => {
this.tagWasDeleted = true;
toggle();
});
await deleteTag(tag);
this.tagWasDeleted = true;
toggle();
};
handleOnClosed = () => {
if (!this.tagWasDeleted) {