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

Tests/ideations unit tests #219

Merged
merged 5 commits into from
Oct 29, 2024
Merged

Tests/ideations unit tests #219

merged 5 commits into from
Oct 29, 2024

Conversation

timDeHof
Copy link
Contributor

@timDeHof timDeHof commented Oct 28, 2024

Description

This PR refactors the ideations unit tests for the controller and services. It refactors the test files to use prisma mock package and updated to test new services. Both tests follow the requirements found in the wiki.

Issue link

#86azu6kwc

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?

Run command yarn test:unit ideations or yarn test:unit:docker 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

…or better coverage

The tests for the ideations controller have been refactored to improve readability and maintainability. New tests have been added to ensure all methods in the controller are tested. This includes tests for createIdeation, createIdeationVote, getIdeationsByVoyageTeam, updateIdeation, deleteIdeation, deleteIdeationVote, setIdeationSelection, and resetIdeationSelection. The mock data and service have also been updated to better reflect the actual data and service. This will help to catch any potential issues or bugs in the future.
@timDeHof timDeHof self-assigned this Oct 28, 2024
The changelog has been updated to reflect the recent changes in the project. This includes the addition of the same site property to the clear cookies function and the creation of routes for teams to create their own tech stack categories. The cors origin list has been updated and the unit tests for the ideations controller and services have been refactored. This documentation update ensures that the changelog accurately represents the current state of the project.
…move unused variables

The unused variables 'ideationArr' and 'ideationVoteArr' were removed from both ideations.controller.spec.ts and ideations.service.spec.ts. Also, the unused import 'ConflictException' was removed from ideations.service.spec.ts. These changes were made to clean up the code and improve readability.
Copy link
Contributor

@JoshuaHinman JoshuaHinman left a comment

Choose a reason for hiding this comment

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

All tests passed - looks good!

Copy link
Contributor

@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.

Thanks, looks good. I read through the code and ran all the tests (all passed)

@timDeHof timDeHof merged commit e213b2e into dev Oct 29, 2024
1 check passed
@timDeHof timDeHof deleted the tests/ideations-unit-tests branch October 29, 2024 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants