-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete: projects and labels with requirements #43
base: master
Are you sure you want to change the base?
Conversation
Allow and ability to delete projects and labels. This will show a warning message before deleting. This will also delete tasks by cascade operation.
void checkIfLabelExist(Label label) async { | ||
_labelDB.isLabelExits(label).then((isExist) { | ||
_labelExistController.sink.add(isExist); | ||
void createOrExists(Label label) async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please write unit tests for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test case : "Add label if not exist in the label db test"
and "Don't Add label if exist in the label db test"
are covering this functionality.
}); | ||
} | ||
|
||
void updateColorSelection(ColorPalette colorPalette) { | ||
_colorController.sink.add(colorPalette); | ||
} | ||
|
||
void deleteLabel(int labelID) async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please write unit tests for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test case Delete label in label list test
covers this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot find the tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the test is located in WhatTodo\test\label_bloc_test.dart
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you find it ?
onTap: () { | ||
homeBloc.applyFilter("@ ${label.name}", Filter.byLabel(label.name)); | ||
context.safePop(); | ||
return Dismissible( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need test for this widget
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, test done Swipe left/right to delete label
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot find the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the test is located in WhatTodo\test\label_dismissible_widget_test.dart
@@ -37,13 +43,28 @@ class ProjectBloc implements BlocBase { | |||
}); | |||
} | |||
|
|||
void createOrExists(Project project) async { | |||
_projectDB.projectExists(project).then((exist) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would have happened if the project already exists? Also, can you please write test for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test case Don't Add project if exist in the project db test
is covering this.
onTap: () { | ||
homeBloc.applyFilter(project.name, Filter.byProject(project.id!)); | ||
context.safePop(); | ||
return Dismissible( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test for dismissing widget to delete project
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test case Swipe left to delete project
is covering this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added feedback and write tests
Allow and ability to delete projects and labels. This will show a warning message before deleting. This will also delete tasks by cascade operation.