Skip to content

UserGuide.md: Claire -> Endorsed Button Feature #87

Description

@fatbiscuit247

Feature 1: Back/Frontend basic functionalities

Feature 2: Add Endorsed Filter

Link to the related user story and pull request(s)
user story #32

**Feature 1: Back/Frontend basic functionalities **

Feature 2: Add Endorsed Filter

Manual Testing

Detailed instructions on how to use and user test your new feature

Feature 1: Regular Utilities of Endorsed Button

  1. Run ./nodebb setup
  2. Run npm install
  3. Run ./nodebb start
  4. Create non-admin account, say username = student, password = whateveryouwouldlike'
  5. Verify the posts do not have any button regarding to an endorsed button as a non-admin.
  6. Click on one non-endorsed post (no button visible) to verify for sure. Remember this post name.
    Non-Admin's Perspective:
image
  1. Log in as admin using username=admin and password=password123!. image
  2. Now click on the same post you viewed earlier as a non-admin.
  3. Verify that you see an endorse this post? button.
    Admin's Perspective:
image
  1. Click on the endorse this post? button to verify it now says endorsed. Verify you can toggle back and forth from endorse this post? and endorsed to verify the status is updating and being written to correctly (when only admin clicks). Also verify no errors/lags/404 errors occur in the console.log.
image
  1. Log back in as your non-admin account. Go to the same post that originally had no sign of an endorsed button --> you made admin changes --> and now verify you can see endorsed by admin blue button!
    Non-Admin's perspective:
image

Feature 2: Endorsed Filter Instructions

  1. Run ./nodebb setup
  2. Run npm install
  3. Run ./nodebb start
  4. Log in to NodeBB as an admin using username=admin and password = password123!
  5. Go to the"Announcements" category. If there are no topics, create a topic. Otherwise, randomly click on a topic.
  6. Click on "endorse this post?" to mark it as "endorsed" image
  7. Return to the categories page, i.e. "Announcements"
  8. Create another topic, post a reply, and endorse that reply
image 11. Return to the "Announcements" page and create a topic without endorsing it. image 12. Return to the "Announcements" page and select "Endorsed Posts" image 13. You can see that it only displays the topics that contain a post or reply that has been endorsed image

Automated Tests

Link/description of where your added automated tests can be found

Feature 1 testing: pr #71 , test/posts/endorsed.tests.js
Feature 2 testing: pr #80 , test/topics-endorsed.js

Description of what is being tested and why you believe the tests are sufficient for covering the changes that you have made

Feature 1:

Test Cases

  • Backend Testcases(9) : main tests --> testing get/put endpoints, testing if endorsed status defaults to false, test if only admin can endorse/un-endorse a post, test that if non-admin tries to endorse-> fails, test if endorsed status properly updated and written to when needed, test that non-registered can still see endorsed posts.
  • Frontend Testcases(2): test frontend display button is displayed correctly, test clicking application on and off correctly correlates/updates/writes to backend status

I believe these are sufficient because they test all the acceptance criteria I created for issue #72: the general cases and edge cases (you can toggle between endorse/un-endorse multiple times) which include reading and writing the new endorsed status, it involves who has the correct permissions , and it also involves the user satisfaction (blue button). When running nodebb, there is also no console.log error and no delays/errors occur. They also pass these test cases, and do not affect the overall code coverage when testing. Therefore, these tests cover the changes that have been made sufficiently.

Feature 2:

Test Cases

  • Backend tests in test/topics-endorsed.js
    • ensure that Topics.filterEndorsedTids returns only endorsed topic tids
    • Topics.filterEndorsedTids handles empty input gracefully
    • Topics.filterEndorsedTids returns multiple endorsed tids when present
    • categories.getCategoryById with filter=endorsed returns only endorsed topics
    • categories.getCategoryById with sort=endorsed behaves like filter=endorsed

These test cases are sufficient since they test all the acceptance criteria for issue #62, with general cases (read/writes correctly read the endorsed status and don't cause any error) and also edge cases (handling empty inputs) all pass these test cases, and still do not affect the overall code coverage when testing. When running nodebb, there is also no console.log error and no delays/errors occur. Therefore, these tests cover the changes that have been made sufficiently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions