-
Notifications
You must be signed in to change notification settings - Fork 269
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
[AAE-9186] Filter tasks by assignee #7784
Conversation
case 'ASSIGNED': | ||
this.assignmentType = AssignmentType.ASSIGNED_TO; | ||
break; | ||
case '': |
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.
is there such a case or is a typo? If there is do we need a break here?
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.
useless case removed
} | ||
}; | ||
|
||
export const mockIdentityUsers: IdentityUserModel[] = [{ |
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.
- You have added mockIdentityUsers obj inside a file that's called edit-task-filter-cloud.mock.ts
- Have you checked if there are already mocks that you can use? I am pretty sure there are as these are quite common mock objects that we probably have tested elsewhere as well
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.
changed mock to one from people-cloud mocks
expect(component.assignmentType).toEqual(AssignmentType.ASSIGNED_TO); | ||
}); | ||
|
||
it('should empty status set assignment type to NONE', () => { |
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's empty status? Something like ALL?
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.
yes, it's equal ALL in this case. changed to ALL (+ used enum instead of string)
type: 'assignment', | ||
attributes: { assignedUsers: 'assignedUsers', candidateGroups: 'candidateGroups'} | ||
}; | ||
component.ngOnInit(); |
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.
is there a way to avoid force calling ngOnInit and do fixture.detectChanges() instead?
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.
changed
expect(component.assignmentType).toEqual(AssignmentType.CANDIDATE_GROUPS); | ||
}); | ||
|
||
it('should set assignment type to CANDIDATE_GROUPS if initial candidateGroups and assignedUsers exists', () => { |
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.
is that possible from the UI to have both candidate groups and assigned users in this filter?
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.
no, unit test removed
this.assignedUsersChange.emit(users); | ||
} | ||
|
||
private changeAssignmentTypeByStatus(status: string) { |
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.
is there any enum about the status that we could use instead of string?
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.
used enum instead of string
if (assignmentChange.value === AssignmentType.CURRENT_USER) { | ||
this.assignedUsersChange.emit([this.identityUserService.getCurrentUserInfo()]); | ||
} else if (assignmentChange.value === AssignmentType.NONE) { | ||
this.assignedUsersChange.emit(undefined); |
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.
could we emit an empty array instead of undefined? Would that be possible?
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.
fixed
0485984
to
e9be624
Compare
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.
Good job 👍
7566dad
to
499ed8f
Compare
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x")
What is the current behaviour? (You can also link to an open issue here)
What is the new behaviour?
Does this PR introduce a breaking change? (check one with "x")
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information: