Skip to content

UserGuide.md: Jerry -> Filter by Course Staff #88

@jarchenn

Description

@jarchenn

Name of Feature: Email Notification

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

Manual Testing

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

  1. Download the .env file from the shared google drive, and add it to the root directory.
  2. Run ./nodebb setup
  3. Run npm install
  4. Run ./nodebb dev
  5. Log in as admin using username=admin and password=password123!. image
  6. Go to Groups in the Left Side Panel
Image
  1. Select "Create New Group" button, name it "course-staff", and click finish
Image
  1. If not a member of the course-staff group, select "Join Group"
Image
  1. Navigate back to the homepage and click on any category that is not the view all category and make a post
Image
  1. Click Filter by Author, and Select "Course Staff Only" in the Dropdown
Image
  1. Confirm that the Test Post created still appear after Filtering by Course Staff
Image
  1. Navigate Back to the Course Staff group, and Leave the Group.
Image
  1. Repeat step 11, but this time the Test Post, or any other Posts created by the Admin Account should not Populate after filtering by Course Staff.
Image

Automated Tests

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

  • Description of the automated tests can be found in this commit in PR Feat/Filter-by-staff #73 in test(category): add integration tests for course staff filtering

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

What is being tested

  • Backend filtering behavior: Verifies that the new courseStaff query parameter correctly filters category topics to only include posts made by users in the "course-staff" group.
  • Edge cases: Ensures correct behavior when the "course-staff" group does not exist or contains no members, confirming that no topics are returned in these cases.
  • Pagination handling: Tests that filtering by course staff works seamlessly with paginated topic lists, ensuring consistent filtering logic even when multiple pages of results exist.

These tests are sufficient because verify that the courseStaff filter functions correctly under normal, error-handling, and pagination scenarios. In normal operation, both staff and non-staff topics exist within a category, and the filter correctly returns only the topics created by members of the "course-staff" group. The error-handling tests ensure that when the "course-staff" group is missing or empty, the API responds gracefully by returning an empty result rather than throwing an error or exposing unrelated topics. Finally, the pagination tests confirm that the filtering logic remains consistent across multiple pages of topics, ensuring complete and accurate results even when the dataset is large. Together, these tests validate the correctness, robustness, and reliability of the courseStaff filtering feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions