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 src/lib/directives/authDirective.ts #797

Closed
SiddheshKukade opened this issue Dec 5, 2022 · 13 comments
Closed
Assignees
Labels
good first issue Good for newcomers test Testing application

Comments

@SiddheshKukade
Copy link
Member

SiddheshKukade commented Dec 5, 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/directives/authDirective.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 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 talawa-api/__tests__/directives/authDirective.spec.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.
@SiddheshKukade SiddheshKukade added unapproved Unapproved for Pull Request points 01 test Testing application labels Dec 5, 2022
@github-actions github-actions bot added the parent Parent issue label Dec 5, 2022
@SiddheshKukade SiddheshKukade added good first issue Good for newcomers and removed parent Parent issue labels Dec 5, 2022
@MaYaNkKashyap681
Copy link

Sir, as a beginner, can I work on this issue,
What are all the prerequisites to start the contribution?

@palisadoes
Copy link
Contributor

Thanks @MaYaNkKashyap681

  1. You can read the CONTRIBUTING.md file for guidance.
  2. You can also contact past contributors like @SiddheshKukade in this thread, or in our slack channel. The link is in the CONTRIBUTING.md file too

@palisadoes palisadoes removed the unapproved Unapproved for Pull Request label Jan 5, 2023
@MaYaNkKashyap681
Copy link

Is there any deadline?

@palisadoes
Copy link
Contributor

palisadoes commented Jan 5, 2023

Issues are automatically labeled unassigned no-issue-activity after 90 days of inactivity. We'd prefer a resolution within a month.

@MaYaNkKashyap681
Copy link

prefer a resolution

ok

@MaYaNkKashyap681
Copy link

MaYaNkKashyap681 commented Jan 7, 2023

Sir,
1). Is the description of the issue wrong, do I need to write the test for lib/helper_functions/authDirective.js, I think
It should be helper_function/deleteImage.js. and the test should be written in tests/helper_functions/deleteImage.spec.js.

2). when I am cloning the master branch, tests/helper_function is not there, instead, there is tests/function, are both the same, or am I cloning a different branch, and I have to write a test for lib/helper_functions/ but the folder helper_function is not inside lib folder

@palisadoes
Copy link
Contributor

@SiddheshKukade Please provide feedback.

@beingnoble03
Copy link
Member

@MaYaNkKashyap681 yes, you are right. There is a different issue for authDirective.ts. The path written here, was before the typescript migration. src/lib/utilities/deleteImage.ts would be the correct path here. You will need to write tests in the file __tests__/utilities/deleteImage.spec.ts.

@SiddheshKukade SiddheshKukade changed the title Resolvers: Create tests for deleteImage.js Resolvers: Create tests for src/lib/directives/authDirective.ts Jan 8, 2023
@SiddheshKukade
Copy link
Member Author

Sir, 1). Is the description of the issue wrong, do I need to write the test for lib/helper_functions/authDirective.js, I think It should be helper_function/deleteImage.js. and the test should be written in tests/helper_functions/deleteImage.spec.js.

2). when I am cloning the master branch, tests/helper_function is not there, instead, there is tests/function, are both the same, or am I cloning a different branch, and I have to write a test for lib/helper_functions/ but the folder helper_function is not inside lib folder

@MaYaNkKashyap681 Hello,
The correct paths for this file are now updated in the issue description.
You can view the latest code coverage for that file here .
Make sure your repository is synced and updated with the latest commit.
You can now find the path for this file in src/lib/directives/authDirective.ts .
You have to add the test files in talawa-api/__tests__/directives/authDirective.spec.ts

@beingnoble03
Copy link
Member

@SiddheshKukade I think we should change the title to previous one, because now this issue has turned into a duplicate issue of #793

@MaYaNkKashyap681
Copy link

Please make things clear, all this is confusing me a lot.

@MaYaNkKashyap681
Copy link

Please update things, so that i can contribute.

@noman2002
Copy link
Member

duplicate of #920

@noman2002 noman2002 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 29, 2023
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

5 participants