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

Resolvers: Create tests for updateUserProfile.ts #559

Closed
palisadoes opened this issue Feb 24, 2022 · 11 comments
Closed

Resolvers: Create tests for updateUserProfile.ts #559

palisadoes opened this issue Feb 24, 2022 · 11 comments
Assignees
Labels
good first issue Good for newcomers test Testing application

Comments

@palisadoes
Copy link
Contributor

palisadoes commented Feb 24, 2022

The Talawa-API code base needs to be 100% reliable. This means we need to have 100% test code coverage.

Tests need to be written for file src/lib/resolvers/Mutation/updateUserProfile.ts

  • We will need the API to be refactored for all methods, classes and/or functions found in this file for testing to be correctly executed.
  • When complete, all all methods, classes and/or functions in the refactored file will need to be tested. These tests must be placed in a
    single file with the name __tests__/resolvers/Mutation/updateUserProfile.ts. You may need to create the appropriate directory structure to do this.

IMPORTANT:

Please refer to the parent issue on how to implement these tests correctly:

PR Acceptance Criteria

  • When complete this file must show 100% coverage when merged into the code base. This will be clearly visible when you submit your PR.
  • The current code coverage for the file can be found here. If the file isn't found in this directory, or there is a 404 error, then tests have not been created.
  • The PR will show a report for the code coverage for the file you have added. You can use that as a guide.
@palisadoes palisadoes added the bug Something isn't working label Feb 24, 2022
@github-actions github-actions bot added parent Parent issue test Testing application unapproved Unapproved for Pull Request labels Feb 24, 2022
@palisadoes palisadoes added good first issue Good for newcomers points 02 and removed bug Something isn't working parent Parent issue labels Mar 2, 2022
@Freedisch
Copy link

@palisadoes I want to know if this issue is still available, because It seems that most of the test cases have already been written but they are still open as an issue.

@palisadoes
Copy link
Contributor Author

We have done many of the tests. Please let me know if any you find that should be closed.

Otherwise feel free to go ahead and work on any that are still valid.

@Freedisch
Copy link

@palisadoes I checked, and there is already a test file for this issue.
I tried to run a test coverage, but i just keep getting these result
image

image

@SiddheshKukade
Copy link
Member

@Freedisch the updateUserProfile.js is having around 30% Code Coverage but expected coverage is 100%
image

@Freedisch
Copy link

@SiddheshKukade, please, how did you run the test coverage, I'm running it on my machine, and I'm not getting any result
I run npm run test and I'm getting no result. Did I miss a step?

@SiddheshKukade
Copy link
Member

@Freedisch it's simple use yarn test --coverage

@Freedisch
Copy link

@SiddheshKukade I keep getting the same error whether with npm run test or yarn test --coverage
· __tests__/resolvers/Query/postsByOrganizationConnection.spec.ts (1) · __tests__/resolvers/Query/organizationsMemberConnection.spec.ts (1) · __tests__/resolvers/Query/postsByOrganization.spec.ts (18) · __tests__/resolvers/Query/posts.spec.ts (18)

@Freedisch
Copy link

Freedisch commented Dec 3, 2022

It's okay I just fixed it, the bug was from my MongoDB setup. I'm working on the issue

@palisadoes palisadoes changed the title Resolvers: Create tests for updateUserProfile.js Resolvers: Create tests for updateUserProfile.ts Jan 23, 2023
@palisadoes
Copy link
Contributor Author

@Freedisch are you still working on this?

@palisadoes palisadoes added points 01 and removed unapproved Unapproved for Pull Request points 02 labels Jan 24, 2023
@kb-0311
Copy link
Contributor

kb-0311 commented Jan 25, 2023

If @Freedisch is unavailable pls assign it to me.

@palisadoes palisadoes assigned kb-0311 and unassigned Freedisch Jan 25, 2023
@palisadoes
Copy link
Contributor Author

100% code coverage has been reached

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers test Testing application
Projects
None yet
Development

No branches or pull requests

4 participants