Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

narivo
Copy link
Contributor

@narivo narivo commented Dec 8, 2022

Allow and ability to delete projects and labels. This will show a warning message before deleting. This will also delete tasks by cascade operation.

 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 {
Copy link
Owner

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?

Copy link
Contributor Author

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 {
Copy link
Owner

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?

Copy link
Contributor Author

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.

Copy link
Owner

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

Copy link
Contributor Author

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

Copy link
Contributor Author

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(
Copy link
Owner

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

Copy link
Contributor Author

@narivo narivo Jan 5, 2023

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

Copy link
Owner

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.

Copy link
Contributor Author

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) {
Copy link
Owner

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.

Copy link
Contributor Author

@narivo narivo Jan 5, 2023

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(
Copy link
Owner

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

Copy link
Contributor Author

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.

Copy link
Owner

@burhanrashid52 burhanrashid52 left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants