Skip to content

Commit

Permalink
Add links to tests in UserGuide.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamed-elzeni authored Oct 20, 2024
1 parent 9037b29 commit 922dd92
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ To use the bug reporting feature, users should navigate to the bug report form b
## Automated Tests

### Posting Anonymously
The ability to post anonymously and hide your user ID has been tested by adding tests in both test/posts.js and test/topics.js for the cases where a post is created successfully when a isAnonymous attribute is added. In addition, the tests ensure that the uid of such created posts are 0, ensuring the anonymity of the author and that their uid was never saved in the database. And thus fully testing the correctness of the feature.
The ability to post anonymously and hide your user ID has been tested by adding tests in both [test/posts.js](https://github.com/CMU-17313Q/nodebb-f24-logic-lords/blob/f24/test/posts.js) and [test/topics.js](https://github.com/CMU-17313Q/nodebb-f24-logic-lords/blob/f24/test/topics.js) for the cases where a post is created successfully when a isAnonymous attribute is added. In addition, the tests ensure that the uid of such created posts are 0, ensuring the anonymity of the author and that their uid was never saved in the database. And thus fully testing the correctness of the feature.

### Content Filtering
Content filtering functionality has been tested thoroughly, with test cases added to the test/post.js file from lines 448 to 478. These tests cover a variety of scenarios to ensure the system accurately detects inappropriate content: (1) The post's title contains inappropriate words, (2) The post's message contains inappropriate words, (3) Neither the title nor the message contains inappropriate words. Each test checks whether the system correctly identifies and handles these cases by displaying appropriate warning messages to users. Given that all possible scenarios are accounted for, the current set of test cases is comprehensive and sufficient to validate the content filtering mechanism.
Content filtering functionality has been tested thoroughly, with test cases added to the [test/posts.js](https://github.com/CMU-17313Q/nodebb-f24-logic-lords/blob/f24/test/posts.js) file from lines 448 to 478. These tests cover a variety of scenarios to ensure the system accurately detects inappropriate content: (1) The post's title contains inappropriate words, (2) The post's message contains inappropriate words, (3) Neither the title nor the message contains inappropriate words. Each test checks whether the system correctly identifies and handles these cases by displaying appropriate warning messages to users. Given that all possible scenarios are accounted for, the current set of test cases is comprehensive and sufficient to validate the content filtering mechanism.

### Bug Reporting and Bug Log

As for the bug report form, it has been tested carfully to ensure its functionality is sucessfully implement by covering essential scenarios which can be found in the test/bug-report-form.js file. Test cases include: (1) The form fetches and logs data correctly upon submission, (2) The email field is validated for proper format, (3) The name field cannot be submitted if left empty, (4) The email field must not be empty, and (5) The bug description cannot be empty as well. Each test validates the form’s ability to handle these cases by checking that submission is prevented when necessary and appropriate error messages are displayed. The tests provide comprehensive coverage to validate the form’s functionality.
As for the bug report form, it has been tested carfully to ensure its functionality is sucessfully implement by covering essential scenarios which can be found in the [test/bug-report-form.js](https://github.com/CMU-17313Q/nodebb-f24-logic-lords/blob/testing-bug-report-form/test/bug-report-form.js) file. Test cases include: (1) The form fetches and logs data correctly upon submission, (2) The email field is validated for proper format, (3) The name field cannot be submitted if left empty, (4) The email field must not be empty, and (5) The bug description cannot be empty as well. Each test validates the form’s ability to handle these cases by checking that submission is prevented when necessary and appropriate error messages are displayed. The tests provide comprehensive coverage to validate the form’s functionality.

The functionality of the Bug-Log button in the admin dashboard navigation has been tested by extending the existing test of 'should load admin dashboard'. The test checks for the loading of the route '/admin/dashboard/bug-logs', guranteeing that the button is in the navigation of the admin dashboard and loads the appropriate view file of a table that would record all reported bugs from the user bug report form (bug-logs.tpl). This contributes to ensure that the admin dashboard comprehensively loads all the correct pre-existing navigation features with the newly added functionality of showing bug-logs.
The functionality of the Bug-Log button in the admin dashboard navigation has been tested by extending the existing test of 'should load admin dashboard'. The test checks for the loading of the route `/admin/dashboard/bug-logs`, guranteeing that the button is in the navigation of the admin dashboard and loads the appropriate view file of a table that would record all reported bugs from the user bug report form (bug-logs.tpl). This contributes to ensure that the admin dashboard comprehensively loads all the correct pre-existing navigation features with the newly added functionality of showing bug-logs.

The bug log page has been tested thoroughly in the file test/bug-logs.js. Test cases include: (1) The fetchBugLogs function correctly fetches and displays bug logs from the API, (2) The submitBugReport function successfully submits a bug report when the description is provided, (3) The bug report description field is validated to ensure it is not empty before submission, (4) The bug logs container is properly emptied and updated with new logs upon fetching, and (5) Error handling is tested to ensure appropriate messages are displayed when fetching or submitting fails. Each test validates the module's ability to handle these cases by checking that the DOM is updated correctly and appropriate console messages are logged. The tests provide comprehensive coverage to validate the module's functionality.
The bug log page has been tested thoroughly in the file [test/bug-logs.js](https://github.com/CMU-17313Q/nodebb-f24-logic-lords/blob/testing/test/bug-logs.js). Test cases include: (1) The fetchBugLogs function correctly fetches and displays bug logs from the API, (2) The submitBugReport function successfully submits a bug report when the description is provided, (3) The bug report description field is validated to ensure it is not empty before submission, (4) The bug logs container is properly emptied and updated with new logs upon fetching, and (5) Error handling is tested to ensure appropriate messages are displayed when fetching or submitting fails. Each test validates the module's ability to handle these cases by checking that the DOM is updated correctly and appropriate console messages are logged. The tests provide comprehensive coverage to validate the module's functionality.

in the case of this user story due to its incompletion this has resulted in manual testing to ensure seperate functionalities are working. We focused on validating key API operations:

Expand Down

0 comments on commit 922dd92

Please sign in to comment.