Skip to content

Improve code coverage#942

Closed
Mutombe wants to merge 20 commits into
unstructuredstudio:masterfrom
Mutombe:2nd-branch
Closed

Improve code coverage#942
Mutombe wants to merge 20 commits into
unstructuredstudio:masterfrom
Mutombe:2nd-branch

Conversation

@Mutombe

@Mutombe Mutombe commented Oct 22, 2023

Copy link
Copy Markdown

Summary

This pull request addresses issue #886 by introducing comprehensive tests for five views in the Projects app. These tests ensure the reliability and correctness of the views, enhancing the overall quality and stability of the application.

Changes

The following changes have been made in this pull request:

  1. Implemented tests for the ProjectCreateAPIView: These tests cover various scenarios related to project creation, validating inputs, handling permissions, and verifying the appropriate response codes and data.

  2. Implemented tests for the ProjectUpdateAPIView: These tests thoroughly examine the functionality of updating project details, including edge cases, error handling, and ensuring the proper behavior of the view under different circumstances.

  3. Implemented tests for the ProjectDeleteAPIView: These tests assess the behavior of the project deletion process, verifying that the appropriate permissions are enforced, confirming the correct response codes, and ensuring the database integrity is maintained.

  4. Implemented tests for the ProjectDetailsAPIView: These tests comprehensively evaluate the functionality of retrieving project details, covering different scenarios, handling various input cases, and validating the correctness of the returned data.

Each of these test implementations incorporates thorough test coverage to safeguard against regressions and ensure the robustness of the Projects app.

By introducing these tests, we can confidently assert the reliability and stability of these critical views, mitigating potential issues and providing a more professional and polished experience for our users.

Please review the changes and provide your feedback.

@Mutombe Mutombe changed the title 2nd branch Improve code coverage Oct 22, 2023
Comment thread zubhub_backend/zubhub/creators/views.py
Comment thread zubhub_backend/zubhub/projects/models.py
Comment thread zubhub_backend/zubhub/projects/serializers.py
Comment thread zubhub_backend/zubhub/projects/utils.py
Comment thread zubhub_backend/zubhub/projects/views.py
Comment thread zubhub_frontend/zubhub/src/views/team/Team.jsx
Comment thread zubhub_frontend/zubhub/src/views/team/Team.jsx
Comment thread zubhub_frontend/zubhub/src/views/edit_team/EditTeam.jsx
Comment thread zubhub_frontend/zubhub/src/store/actions/userActions.js
Comment thread zubhub_frontend/zubhub/src/App.js Outdated
Comment thread zubhub_frontend/zubhub/src/App.js Outdated
Comment thread zubhub_frontend/zubhub/src/components/form/imageInput/ImageInput.jsx Outdated
Comment thread zubhub_frontend/zubhub/src/components/form/imageInput/ImageInput.jsx Outdated
Comment thread zubhub_frontend/zubhub/src/components/form/imageInput/ImageInput.jsx Outdated
Comment thread zubhub_frontend/zubhub/src/views/team/Team.jsx Outdated
Comment thread zubhub_frontend/zubhub/src/components/form/imageInput/ImageInput.jsx Outdated

@NdibeRaymond NdibeRaymond left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hello @Mutombe, thanks for much for working on this! testing is something we are really lacking and I am glad someone is taking on that. I requested a couple of changes. Do you mind taking a look?

Comment thread zubhub_backend/zubhub/projects/tests.py Outdated
Comment thread zubhub_backend/zubhub/projects/tests.py Outdated
Comment thread zubhub_backend/zubhub/projects/tests.py Outdated
Comment thread zubhub_backend/zubhub/projects/tests.py
@Mutombe

Mutombe commented Oct 26, 2023

Copy link
Copy Markdown
Author

Hello @Mutombe, thanks for much for working on this! testing is something we are really lacking and I am glad someone is taking on that. I requested a couple of changes. Do you mind taking a look?

Roger that.

@NdibeRaymond

Copy link
Copy Markdown
Collaborator

hello @Mutombe, I see that you still have have of the things in the previous review in this patch. I'd advise you remove them so we can merge this. I can work you through the process of doing this if you'd like:

  • first update your master branch. this command git checkout master && git pull origin master will do that for you.
  • next create a new branch with git checkout -b name_of_the_branch_here
  • next copy over your main changes from 2nd-branch to the new branch. you might have to do this manually
  • commit the changes and push to github.
  • then you have to change the base branch of this PR to the new branch. If that is difficult you might need to create a new PR and close this one.
  • also when next you want to merge changes from the master branch into your working branch, use rebase instead of pull as this helps to keep the history clean and makes review easy. to do this you start with git rebase -i origin/master and follow the provided instructions. you can also read this online and it probably won't take more than 20mins to get the hang of it

@NdibeRaymond

Copy link
Copy Markdown
Collaborator

also ensure that your own copy of the repository is up to date

@Mutombe Mutombe closed this by deleting the head repository Oct 31, 2023
@Mutombe

Mutombe commented Oct 31, 2023

Copy link
Copy Markdown
Author

Done

#987

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.

2 participants