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 #49

Closed
wants to merge 1 commit into from
Closed

Update test/topics.js - Sofia edit #49

wants to merge 1 commit into from

Conversation

sofiareyesf
Copy link

@sofiareyesf sofiareyesf commented Oct 6, 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."
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.

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
Development

Successfully merging this pull request may close these issues.

US #5- Add pin button on all posts within the interface (ONLY ACCESSIBLE TO INSTRUCTORS)
3 participants