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

Update test/topics.js - Sofia edit #51

Merged
merged 1 commit into from
Oct 9, 2024
Merged

Update test/topics.js - Sofia edit #51

merged 1 commit into from
Oct 9, 2024

Conversation

sofiareyesf
Copy link

@sofiareyesf sofiareyesf commented Oct 7, 2024

What
Added functionality to pin important posts at the top of the Q&A section. This ensures that critical posts, such as announcements or key instructions, remain visible to students and do not get lost among other posts. Also added associated unit tests to verify this functionality.

Why
Addresses the user story:
"As an instructor, I want to pin important posts at the top of the Q&A section, so that students can see relevant announcements or information easily." (User story #5 ). close #5
This feature contributes to a more organized learning experience by making important information readily accessible to students.

How
Changes were made in:

src/api/categories.js (Backend logic to pin/unpin topics)
src/controllers/category.js (Ensure pinned topics are displayed at the top)
src/privileges/topics.js (Adjusting privileges to ensure only instructors can pin topics)
src/topics/pin.js (Handling the pin button interaction)
test/topics.js (Unit tests for pin functionality)
Testing
Manual user tests were conducted to confirm functionality as follows:

Login as an instructor.
Navigate to the Q&A section.
Select an existing topic or create a new one.
Click on the "Topic Tools" option and choose "Pin Topic."
Verify that the post remains pinned at the top of the Q&A section.
Login as a regular user (student) and verify that the pinned post is visible at the top of the Q&A section.
Ensure regular users cannot access the "Pin Topic" functionality.
Location of Automated Tests
File: test/topics.js
Lines: 691-702

These tests ensure that the server updates the topic object correctly when interacting with the pin button.

@sofiareyesf sofiareyesf changed the title Revert to first commit Update test/topics.js - Sofia edit Oct 7, 2024
@coveralls
Copy link

Pull Request Test Coverage Report for Build 11223446942

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 82.679%

Totals Coverage Status
Change from base Build 11204917135: 0.0%
Covered Lines: 22337
Relevant Lines: 25596

💛 - Coveralls

@shantinghou shantinghou self-requested a review October 8, 2024 16:05
@shantinghou shantinghou added the enhancement New feature or request label Oct 8, 2024
@shantinghou shantinghou added this to the Sprint 2 milestone Oct 8, 2024
@shantinghou
Copy link

LGTM! Can you link this to your user story under development?

@sofiareyesf sofiareyesf merged commit 062fcf6 into f24 Oct 9, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pin
Projects
None yet
5 participants