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

Explicit logic for update invite handler #38

Open
maxceem opened this issue Mar 18, 2020 · 0 comments
Open

Explicit logic for update invite handler #38

maxceem opened this issue Mar 18, 2020 · 0 comments
Milestone

Comments

@maxceem
Copy link
Contributor

maxceem commented Mar 18, 2020

At the moment handler for updated invites https://github.com/topcoder-platform/project-processor-es/blob/feature/before-remove-invite-fix/src/services/ProcessorServiceProjectMemberInvite.js#L72-L75 always remove invite from the project because we don't have any other situations when we are calling this handler.

But this logic might be confusing. We have to make the logic more clear and explicit.

Add condition:

  1. If invite status is accepted, refused, request_rejected, request_approved, canceled, then remove invite from the list as we do now.
  2. If invite status is another one, then just update invite object in the list. (at the moment we never have such statuses in real life).

We already have a unit tests which check the first case.
Create another unit test that would check the second test. We have to more statuses left for testing: pending and requested. So for the unit test, we can create an invite in one of these statuses and change it to another status.

@vikasrohit vikasrohit added this to the 1.2.0 milestone Mar 20, 2020
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

No branches or pull requests

2 participants