- STORY9: Added filtering for posts based on geolocation.
- STORY10: Developed a UI feature for choosing geolocation radius.
- STORY11: Implemented frontend unit tests and a Cypress end-to-end test.
- STORY12: Created backend tests using the Go testing suite and refactored backend code for modularity and properly fetching user id from the database. Also added functionality to delete users and posts through the API.
- STORY19: Update radius filter component for better styling.
- STORY13: Add like/dislike functionality to posts if you are logged in, both front/backend.
- STORY14: Add comment functionality to posts if you are logged in, both front/backend.
- STORY15: Support other types of media on posts in the frontend (Images).
- STORY16: Add support for storing image/video for all users (backend).
- STORY17: Add page limit/loading for posts frontend.
- STORY18: Add page limit for posts backend.
- TestLoginPage: Verifies that the login form renders correctly and handles authentication responses.
- TestSubmitPage: Tests the post submission form functionality and validation.
- TestFeed: Validates the feed component's rendering, post loading, filtering capabilities, and error handling states.
- TestPostCard: Ensures proper rendering of post content, interaction handling (likes), and date/location formatting.
- TestRadiusFilter: Checks the radius filter slider functionality, value conversions, and callback handling.
- TestSliderFunctions: Validates the utility functions for converting and formatting distance values used in the radius filter.
- TestAPI: Verifies API service functions, including endpoint calls and parameter handling.
- AuthSpec: Tests the authentication flow, including login, registration, and error handling.
- HomePageSpec: Verifies the home page functionality, including post loading and interaction with post content.
- RadiusFilterSpec: Validates the radius filter component’s integration with the feed.
- TestNewDBInterface: Verifies that the database connection initializes correctly.
- TestRegister: Tests user registration.
- TestAuthenticate: Tests user authentication and retrieval of
user_id. - TestPost: Tests that a logged-in user can create a post.
- TestDeleteUser: Tests user deletion and cleanup of associated posts.
- TestCloseDB: Ensures the database connection closes properly.
- TestRegisterEndpoint: Tests the
/api/registerendpoint for user registration. - TestLoginEndpoint: Tests the
/api/loginendpoint for user login. - TestCreatePostEndpoint: Tests the
/api/postsendpoint for creating a post. - TestGetPostsEndpoint: Tests the
/api/postsendpoint for retrieving posts. - TestDeleteUserEndpoint: Tests the
/api/delete-userendpoint for deleting a user. - TestDeletePostEndpoint: Tests the
/api/posts/{id}endpoint for deleting a post.
Endpoint: POST /api/register
Request Body:
{
"username": "exampleUser",
"password": "examplePass"
}Response:
{ "message": "User registered successfully" }Endpoint: POST /api/login
Request Body:
{
"username": "exampleUser",
"password": "examplePass"
}Response:
{
"message": "Login successful",
"user_id": 1
}Endpoint: DELETE /api/delete-user
Request Body:
{ "username": "exampleUser" } Response:
{ "message": "User deleted successfully" }Endpoint: POST /api/posts
Request Body:
{
"user_id": 1,
"content": "This is a test post",
"latitude": 37.7749,
"longitude": -122.4194
} Response:
{ "message": "Post created successfully" }Endpoint: GET /api/posts?latitude={reqLatitude}&longitude={reqLongitude}&distance={distance}
Response:
{
"post_id": 1,
"username": "exampleUser",
"content": "This is a test post",
"latitude": 37.7749,
"longitude": -122.4194,
"created_at": "2024-03-03T12:00:00Z"
} Endpoint: DELETE /api/posts/{id}
Response:
{ "message": "Post deleted successfully" }