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 ideation vote and ideation #161

Merged
merged 4 commits into from
Jun 10, 2024
Merged

Conversation

JoshuaHinman
Copy link
Contributor

@JoshuaHinman JoshuaHinman commented Jun 6, 2024

Description

This PR updates the DELETE voyages/teams/{teamId}/ideations/{ideationId}/ideation-votes route to also delete the corresponding ideation, if there are no more votes for it.

Notes:
Functions deleteIdeation and deleteIdeationVote have been refactored to avoid conflicting with each other
Upated e2e tests to check deletion of ideation when last vote is deleted
Fixed conflicts with other tests

Issue link

Fixes # 86b0fw6kn

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature updates / changes
  • Tests
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

In swagger: Login, post vote for team 1, ideation 1
In Prisma Studio: delete original projectIdeaVote (id: 1)
In Swagger: delete vote for team 1, ideation 1
Check results in Studio: no projectIdeaVotes for 1 , no projectIdea 1

Tests:
yarn test:e2e ideations

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have updated the change log

Copy link
Collaborator

@timDeHof timDeHof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job, all the e2e testing passed and but the unit tests failed for ideations.service.spec.ts on line 252. could you look into it?

@JoshuaHinman JoshuaHinman marked this pull request as draft June 9, 2024 15:34
@JoshuaHinman JoshuaHinman marked this pull request as ready for review June 9, 2024 15:34
Copy link
Collaborator

@timDeHof timDeHof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the E2E test pass for ideation but I still getting a failure for the ideations.service.spec.ts on line 252. I think the issue is that you are comparing the result object to the ideationVoteOne object, which the later has projectIdeaId and the result has just id. I think checking if these ids are equal would pass the unit tests.

@cherylli
Copy link
Collaborator

cherylli commented Jun 10, 2024

They are working for me
image

Although I wouldn't stress too much as we are adding new unit tests and might have to redo the old ones

Copy link
Collaborator

@timDeHof timDeHof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, since the unit tests worked for @cherylli. I'll say it a pass then. but it does seem to be out-of-date with dev branch.

Copy link
Collaborator

@cherylli cherylli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merged dev into the branch, rerun tests locally, all passed
also tested manually with swagger and works as expected 👍

@JoshuaHinman JoshuaHinman merged commit 2179c4f into dev Jun 10, 2024
1 check passed
@JoshuaHinman JoshuaHinman deleted the update/delete-ideation-vote branch June 10, 2024 11:41
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.

3 participants