From c64ba05044929ad8d8c4666db12d07a10c974378 Mon Sep 17 00:00:00 2001 From: SamFaMH <121002154+SamFaMH@users.noreply.github.com> Date: Fri, 18 Jul 2025 18:17:01 +0530 Subject: [PATCH] feat(test): add manual test cases and unit test --- .../UserDashboardContent.test.tsx | 89 +++++ __tests__/manual/adminSuggestionsManual.html | 68 ++++ __tests__/manual/adminUsersManual.html | 64 ++++ __tests__/manual/feedbackManual.html | 65 ++++ __tests__/manual/profileSettings.html | 68 ++++ __tests__/manual/userDashoard.html | 178 +++++++++ __tests__/manual/userSuggestions.html | 341 ++++++++++++++++++ 7 files changed, 873 insertions(+) create mode 100644 __tests__/components/userDashboard/UserDashboardContent.test.tsx create mode 100644 __tests__/manual/adminSuggestionsManual.html create mode 100644 __tests__/manual/adminUsersManual.html create mode 100644 __tests__/manual/feedbackManual.html create mode 100644 __tests__/manual/profileSettings.html create mode 100644 __tests__/manual/userDashoard.html create mode 100644 __tests__/manual/userSuggestions.html diff --git a/__tests__/components/userDashboard/UserDashboardContent.test.tsx b/__tests__/components/userDashboard/UserDashboardContent.test.tsx new file mode 100644 index 00000000..aa7c3f01 --- /dev/null +++ b/__tests__/components/userDashboard/UserDashboardContent.test.tsx @@ -0,0 +1,89 @@ +import React from 'react'; +import { render, screen } from '@testing-library/react'; +import UserDashboardContent from '@/components/User/DashboardContent/UserDashboardContent'; +import { useAuth } from '@/lib/context/AuthContext'; +import { useSessionTimer } from '@/lib/hooks/useSessionTimer'; + + +// Mock child components +jest.mock('@/components/Dashboard/UserSkills', () => { + const MockUserSkills = () =>
; + MockUserSkills.displayName = 'MockUserSkills'; + return MockUserSkills; +}); +jest.mock('@/components/Dashboard/SkillsRequested', () => ({ + SkillsRequested: () => , + SkillsOffered: () => +})); +jest.mock('@/components/Dashboard/ReviewSummary', () => ({ + ReviewSummary: () => +})); +jest.mock('@/components/Dashboard/EarnedBadges', () => { + const MockEarnedBadges = () => ; + MockEarnedBadges.displayName = 'MockEarnedBadges'; + return MockEarnedBadges; +}); + +jest.mock('@/components/Dashboard/ProfileCard', () => { + const MockProfileCard = () => ; + MockProfileCard.displayName = 'MockProfileCard'; + return MockProfileCard; +}); +jest.mock('@/components/Dashboard/TimeSpentChart', () => ({ + TimeSpentChart: () => +})); +jest.mock('@/components/Dashboard/SkillMatchOverview', () => { + const MockSkillMatchOverview = () => ; + MockSkillMatchOverview.displayName = 'MockSkillMatchOverview'; + return MockSkillMatchOverview; +}); + +// Mock hooks +jest.mock('@/lib/context/AuthContext', () => ({ + useAuth: jest.fn() +})); +jest.mock('@/lib/hooks/useSessionTimer', () => ({ + useSessionTimer: jest.fn() +})); + +describe('UserDashboardContent', () => { + const mockUser = { + _id: '123', + firstName: 'Samha', + lastName: 'fathima' + }; + + beforeEach(() => { + (useAuth as jest.Mock).mockReturnValue({ user: mockUser }); + (useSessionTimer as jest.Mock).mockReturnValue(null); + }); + + it('renders greeting with user full name', () => { + render( +Tester: Fathima Samha
+Version: Not specified
+Browser: Chrome
+Device: Desktop
+Test Date: 2025-07-17
+| # | +Test Name | +Priority | +Preconditions | +Test Steps | +Expected Result | +Actual Result | +Status | +
|---|---|---|---|---|---|---|---|
| 1 | Error State | HIGH | API returns error | 1. Simulate API error 2. Load Suggestions page | Error message shown | Error message displayed: "Failed to load suggestions" | PASS |
| 2 | Empty State | MEDIUM | No suggestions in DB | 1. Load Suggestions page | "No suggestions found" message shown | No suggestions found message displayed | PASS |
| 3 | Search by Name | HIGH | Suggestions exist | 1. Enter name in search 2. Observe results | Only matching suggestions shown | Search filters suggestions by name correctly | PASS |
| 4 | Search by Title | HIGH | Suggestions exist | 1. Enter title in search 2. Observe results | Only matching suggestions shown | Search filters suggestions by title correctly | PASS |
| 5 | Clear Search | MEDIUM | Search active | 1. Click clear button | Search input cleared, all suggestions shown | Search cleared, all suggestions displayed | PASS |
| 6 | Filter by Category | MEDIUM | Multiple categories exist | 1. Select category filter | Only suggestions in selected category shown | Category filter works | PASS |
| 7 | Pagination Next/Prev | HIGH | >1 page of suggestions | 1. Click next/prev page | Suggestions list updates to correct page | Pagination works, correct page shown | PASS |
| 8 | Pagination Direct Page | MEDIUM | >5 pages of suggestions | 1. Click a page number | Suggestions list updates to selected page | Direct page navigation works | PASS |
| 9 | Approve Suggestion | HIGH | Suggestions exist | 1. Click approve on suggestion | Status updates to Approved, toast shown | Status updated, toast shown | PASS |
| 10 | Reject Suggestion | HIGH | Suggestions exist | 1. Click reject on suggestion | Status updates to Rejected, toast shown | Status updated, toast shown | PASS |
| 11 | View Suggestion Details | MEDIUM | Suggestions exist | 1. Click on suggestion row/card | Modal opens with suggestion details | Modal opens, details shown | PASS |
| 12 | Close Suggestion Modal | MEDIUM | Modal open | 1. Click close button | Modal closes | Modal closed | PASS |
| 13 | Open Summary Modal | HIGH | Suggestions exist | 1. Click "View Summary" | Summary modal opens | Summary modal opens | PASS |
| 14 | Close Summary Modal | MEDIUM | Summary modal open | 1. Click close button | Modal closes | Modal closed | PASS |
| 15 | Summary Modal Error State | HIGH | API returns error | 1. Simulate API error 2. Open summary modal | Error message shown | Error message displayed: "Failed to load summary" | PASS |
| 16 | Summary Modal Empty State | MEDIUM | No pending suggestions | 1. Open summary modal | "No pending suggestions to summarize" shown | Message displayed | PASS |
| 17 | Summary Modal Insights Tab | HIGH | Summary data exists | 1. Open summary modal 2. View Insights tab | Insights and analysis displayed | Insights shown | PASS |
| 18 | Summary Modal Similarity Tab | HIGH | Summary data exists | 1. Open summary modal 2. View Similarity tab | Similarity groups displayed | Similarity groups shown | PASS |
| 19 | Category Stats in Summary | MEDIUM | Summary data exists | 1. Open summary modal 2. View category breakdown | Category stats shown | Category stats displayed | PASS |
| 20 | Action Recommendations in Summary | MEDIUM | Summary data exists | 1. Open summary modal 2. View recommendations | Recommendations shown | Recommendations displayed | PASS |
Tester: Fathima Samha
+Version: Not specified
+Browser: Chrome
+Device: Desktop
+Test Date: 2025-07-17
+| # | +Test Name | +Priority | +Preconditions | +Test Steps | +Expected Result | +Actual Result | +Status | +
|---|---|---|---|---|---|---|---|
| 1 | Users List Loads | HIGH | Admin logged in | 1. Navigate to Users page | List of users loads, shows user info | User list loaded, all info visible | PASS |
| 3 | Error State | HIGH | API returns error | 1. Simulate API error 2. Load Users page | Error message shown | Error message displayed: "Failed to fetch users" | PASS |
| 4 | Empty State | MEDIUM | No users in DB | 1. Load Users page | "No users found" message shown | No users found message displayed | PASS |
| 5 | Search by Name | HIGH | Users exist | 1. Enter name in search 2. Observe results | Only matching users shown | Search filters users by name correctly | PASS |
| 6 | Search by Email | HIGH | Users exist | 1. Enter email in search 2. Observe results | Only matching users shown | Search filters users by email correctly | PASS |
| 7 | Search by Title | MEDIUM | Users exist | 1. Enter title in search 2. Observe results | Only matching users shown | Search filters users by title correctly | PASS |
| 8 | Clear Search | MEDIUM | Search active | 1. Click clear button | Search input cleared, all users shown | Search cleared, all users displayed | PASS |
| 9 | Pagination Next/Prev | HIGH | >1 page of users | 1. Click next/prev page | User list updates to correct page | Pagination works, correct page shown | PASS |
| 10 | Pagination Direct Page | MEDIUM | >5 pages of users | 1. Click a page number | User list updates to selected page | Direct page navigation works | PASS |
| 11 | Change Page Size | MEDIUM | Users exist | 1. Change page size dropdown | User list updates, correct # per page | Page size changes, correct number shown | PASS |
| 12 | Sort by Name | HIGH | Users exist | 1. Sort by first/last name | List sorted correctly | Sort by name works as expected | PASS |
| 13 | Sort by Email | MEDIUM | Users exist | 1. Sort by email | List sorted correctly | Sort by email works as expected | PASS |
| 14 | Sort by Created At | MEDIUM | Users exist | 1. Sort by created date | List sorted correctly | Sort by created date works | PASS |
| 15 | Sort Order Toggle | MEDIUM | Users exist | 1. Toggle sort order | List order reverses | Sort order toggles as expected | PASS |
| 16 | Delete User (Soft) | HIGH | Users exist | 1. Click delete on user 2. Confirm in modal | User removed from list, toast shown | User deleted, toast shown | PASS |
| 17 | Cancel Delete | MEDIUM | Users exist | 1. Click delete 2. Cancel modal | No user deleted, modal closes | Modal closed, no user deleted | PASS |
Tester: Fathima Samha
+Version: Not specified
+Browser: Chrome
+Device: Desktop
+Test Date: 2025-07-17
+| # | +Test Name | +Priority | +Preconditions | +Test Steps | +Expected Result | +Actual Result | +Status | +
|---|---|---|---|---|---|---|---|
| 1 | Feedback Required | HIGH | On Feedback form | 1. Leave Feedback empty 2. Submit | Error: "Feedback must be at least 10 characters long" | Error shown | PASS |
| 2 | Feedback Only Spaces | HIGH | On Feedback form | 1. Enter only spaces in Feedback 2. Submit | Error: "Feedback cannot be only spaces" | Error shown | PASS |
| 3 | Feedback Not Enough Letters | HIGH | On Feedback form | 1. Enter "1234567890" in Feedback 2. Submit | Error: "Feedback must contain at least 10 letters" | Error shown | PASS |
| 4 | Feedback Too Short | HIGH | On Feedback form | 1. Enter "short" in Feedback 2. Submit | Error: "Feedback must be at least 10 characters long" | Error shown | PASS |
| 5 | Valid Feedback | HIGH | On Feedback form | 1. Enter valid feedback (10+ letters) 2. Submit | Feedback submitted, success message shown | Success message shown | PASS |
| 6 | Rating Required | HIGH | On Feedback form | 1. Deselect all ratings 2. Submit | Error: "Required" or similar | Error shown | PASS |
| 7 | Rating Min/Max | HIGH | On Feedback form | 1. Select rating below 1 or above 5 (if possible) 2. Submit | Error: "Rating must be between 1 and 5" | Not possible in UI | PASS |
| 8 | Zero Rating | HIGH | On Feedback form | 1. Set rating to 0 (if possible) 2. Submit | Error: "Rating must be between 1 and 5" | Error shown | FAIL |
| 9 | Anonymous Option | MEDIUM | On Feedback form | 1. Check "Submit as anonymous" 2. Submit valid feedback | Feedback submitted as anonymous | Success, no name shown | PASS |
| 10 | Display Name Validation | MEDIUM | On Feedback form | 1. Enter "12" as Display Name 2. Submit | Error: "Display name must contain at least 3 letters" | Error shown | PASS |
| 11 | Display Name Valid | MEDIUM | On Feedback form | 1. Enter "Samha" as Display Name 2. Submit valid feedback | Feedback submitted, name shown | Success, name shown | PASS |
| 12 | Success Story Optional | MEDIUM | On Feedback form | 1. Leave Success Story empty 2. Submit valid feedback | Feedback submitted, no error | Success | PASS |
| 13 | Success Story Required When Allowed | HIGH | On Feedback form | 1. Check "Allow to post as success story" 2. Leave Success Story empty 3. Submit | Error: "Success story must contain at least 10 letters" | Error shown | PASS |
| 14 | Success Story Not Enough Letters | HIGH | On Feedback form | 1. Check "Allow to post as success story" 2. Enter "1234567890" in Success Story 3. Submit | Error: "Success story must contain at least 10 letters" | Error shown | PASS |
| 15 | Valid Success Story | HIGH | On Feedback form | 1. Check "Allow to post as success story" 2. Enter valid story (10+ letters) 3. Submit | Feedback submitted, success message shown | Success message shown | PASS |
| 16 | Form Reset After Submit | MEDIUM | On Feedback form | 1. Submit valid feedback 2. Observe form | Form resets, fields cleared | Form reset | PASS |
| 17 | API Error on Submit | MEDIUM | On Feedback form | 1. Simulate API error 2. Submit valid feedback | Error toast shown | Error toast shown | PASS |
Tester: Fathima Samha
+Version: Not specified
+Browser: Chrome
+Device: Desktop
+Test Date: 2025-07-17
+| # | +Test Name | +Priority | +Preconditions | +Test Steps | +Expected Result | +Actual Result | +Status | +
|---|---|---|---|---|---|---|---|
| 1 | Profile Loads for Authenticated User | HIGH | User is logged in | 1. Navigate to Profile Settings | Profile form loads with user data | Form loaded, data shown | PASS |
| 2 | Edit Profile Button Works | HIGH | Profile loaded | 1. Click "Edit Profile" | Fields become editable, Save/Discard buttons appear | Fields editable | PASS |
| 3 | Cancel Edit Discards Changes | HIGH | In edit mode | 1. Change a field 2. Click "Cancel" | Changes are not saved, view mode restored | Changes discarded | PASS |
| 4 | Discard Changes Button | HIGH | In edit mode | 1. Change a field 2. Click "Discard Changes" | Changes are not saved, view mode restored | Changes discarded | PASS |
| 5 | Save Changes Button | HIGH | In edit mode | 1. Change a field 2. Click "Save Changes" | Changes are saved, success message shown | Changes saved, message shown | PASS |
| 6 | First Name Required | HIGH | In edit mode | 1. Clear First Name 2. Try to save | Browser shows required field error | Error shown, cannot save | PASS |
| 7 | Last Name Required | HIGH | In edit mode | 1. Clear Last Name 2. Try to save | Browser shows required field error | Error shown, cannot save | PASS |
| 8 | Email Required | HIGH | In edit mode | 1. Clear Email 2. Try to save | Browser shows required field error | Error shown, cannot save | PASS |
| 9 | Email Format Validation | HIGH | In edit mode | 1. Enter "notanemail" in Email 2. Try to save | Browser shows invalid email error | Error shown, cannot save | PASS |
| 10 | Phone Optional | MEDIUM | In edit mode | 1. Clear Phone 2. Save | Profile saves without phone | Saved, no error | PASS |
| 11 | Title Optional | MEDIUM | In edit mode | 1. Clear Title 2. Save | Profile saves without title | Saved, no error | PASS |
| 12 | Avatar Upload Accepts Image | HIGH | In edit mode | 1. Click avatar 2. Upload valid image file | Avatar preview updates, can save | Preview updates, saved | PASS |
| 13 | Avatar Upload Rejects Non-Image | HIGH | In edit mode | 1. Try to upload .txt or .pdf file | File not accepted, no preview | File not accepted | PASS |
| 14 | Avatar Upload Cancel | MEDIUM | In edit mode | 1. Click avatar 2. Cancel file dialog | No change to avatar | No change | PASS |
| 15 | Large Image Upload | MEDIUM | In edit mode | 1. Upload very large image | Preview updates, very slow | Not tested | NOT EXECUTED |
| 16 | Save With All Fields Changed | HIGH | In edit mode | 1. Change all fields 2. Save | All changes saved, message shown | All changes saved | PASS |
| 17 | Save With No Changes | LOW | In edit mode | 1. Click Save without changing anything | No error, message shown | No error, message shown | PASS |
| 18 | Network Error on Save | MEDIUM | In edit mode | 1. Disconnect network 2. Try to save | Error message shown | Error shown | PASS |
| 20 | Profile Loads With Missing Data | LOW | User has missing fields | 1. Navigate to Profile Settings | Fields show "Not provided" | "Not provided" shown | PASS |
| 21 | Avatar Loads Default If None | LOW | User has no avatar | 1. Navigate to Profile Settings | Default avatar shown | Default shown | PASS |
Tester: Fathima Samha
+Version: Not specified
+Browser: Chrome
+Device: Desktop
+Test Date: 2025-07-17
+| # | +Test Name | +Priority | +Preconditions | +Test Steps | +Expected Result | +Actual Result | +Status | +
|---|---|---|---|---|---|---|---|
| 1 | +Dashboard Loads for Authenticated User | +HIGH | +User is logged in | +1. Navigate to /dashboard | +Dashboard greets user by name and loads content | +Loaded with "Hi Fathima Samhanpm run , Welcome back!" | +PASS | +
| 2 | +ProfileCard Component Renders | +HIGH | +User has valid userId | +1. Check right sidebar 2. Confirm profile card is visible |
+ Profile card with user data appears | +Profile shown | +PASS | +
| 3 | +SkillsRequested Section Renders | +HIGH | +User is logged in | +1. Scroll to main column 2. Confirm "Skills Requested" section shows |
+ SkillsRequested component renders with data | +Section displayed | +PASS | +
| 4 | +SkillsOffered Section Renders | +HIGH | +User is logged in | +1. Locate "Skills Offered" section | +SkillsOffered component is visible and styled | +Section rendered as expected | +PASS | +
| 5 | +UserSkills Component View More | +MEDIUM | +User on dashboard | +1. Click "View More" in UserSkills component | +`onNavigateToMySkills` handler is triggered | +Navigation triggered | +PASS | +
| 6 | +ReviewSummary Shows When User Exists | +HIGH | +User is logged in | +1. Scroll to Review section 2. Check if ReviewSummary is rendered |
+ ReviewSummary visible with review stats | +Component visible | +PASS | +
| 7 | +EarnedBadges Shows When User Exists | +MEDIUM | +User is logged in | +1. Scroll down to "Badges" | +Badges with earned info should be visible | +Badges loaded | +PASS | +
| 8 | +TimeSpentChart Component Loads | +HIGH | +User is logged in | +1. Locate "Time Spent" box 2. Confirm chart loads |
+ Chart rendered with user stats | +Chart loaded | +PASS | +
| 9 | +SkillMatchOverview Works | +MEDIUM | +User is on dashboard | +1. Scroll to Skill Matches 2. Verify component renders |
+ Component renders with "View All" hook | +Rendered with no crash | +PASS | +
| 10 | +Session Timer Hook Runs Without Crash | +MEDIUM | +User has valid _id | +1. Load dashboard 2. Open dev tools console |
+ No hook errors, timer starts silently | +No errors | +PASS | +
| 11 | +“View All Reviews” Button Appears | +MEDIUM | +User has more than 3 reviews | +
+ 1. Navigate to Dashboard + 2. Scroll to Reviews section + 3. Observe review count + 4. Check if “View all reviews” button appears + |
+ Button appears only if reviews > 3 | +“View all 4 reviews →” button shown | +PASS | +
| 12 | +Navigate to All Reviews Page | +MEDIUM | +“View all reviews” button is visible | +
+ 1. Click “View all 4 reviews →” + 2. Observe navigation + 3. Confirm all reviews are visible on target page + |
+ User is taken to full reviews page | +Navigated to `/reviews` and saw all reviews | +PASS | +
Tester: Fathima Samha
+Version: Not specified
+Browser: Chrome
+Device: Desktop
+Test Date: 2025-07-17
+| # | +Test Name | +Priority | +Preconditions | +Test Steps | +Expected Result | +Actual Result | +Status | +
|---|---|---|---|---|---|---|---|
| 1 | +Suggestions Tab Loads | +HIGH | +User is logged in | +1. Navigate to Dashboard 2. Go to Suggestions section/tab |
+ Suggestions UI loads with "Submit Suggestion" and "Your History" tabs | +Tabs loaded as expected | +PASS | +
| 2 | +Suggestion Form Validation | +HIGH | +User is on Suggestions tab | +1. Leave all fields empty 2. Click Submit |
+ Validation errors for all fields | +All validation errors shown | +PASS | +
| 3 | +Title Validation | +HIGH | +User is on Suggestions tab | +1. Enter less than 3 letters in Title 2. Fill other fields validly 3. Submit |
+ Error: "Title must be at least 3 characters after trimming" | +Error message shown | +PASS | +
| 4 | +Description Validation | +HIGH | +User is on Suggestions tab | +1. Enter less than 10 letters in Description 2. Fill other fields validly 3. Submit |
+ Error: "Description must be at least 10 characters after trimming" | +Error message shown | +PASS | +
| 5 | +Category Validation | +HIGH | +User is on Suggestions tab | +1. Leave Category unselected 2. Fill other fields validly 3. Submit |
+ Error: "Please select a category" | +Error message shown | +PASS | +
| 6a | +All Fields Empty | +HIGH | +On Suggestions tab | +1. Leave all fields empty 2. Click Submit |
+ Errors for Title, Description, Category | +All validation errors shown | +PASS | +
| 6b | +Title Too Short | +HIGH | +On Suggestions tab | +1. Enter "Hi" in Title 2. Fill other fields validly 3. Submit |
+ Error: "Title must be at least 3 characters after trimming" | +Error message shown | +PASS | +
| 6c | +Title Not Enough Letters | +HIGH | +On Suggestions tab | +1. Enter "12@" in Title 2. Fill other fields validly 3. Submit |
+ Error: "Title must contain at least 3 letters" | +Error message shown | +PASS | +
| 6d | +Description Too Short | +HIGH | +On Suggestions tab | +1. Enter "Short" in Description 2. Fill other fields validly 3. Submit |
+ Error: "Description must be at least 10 characters after trimming" | +Error message shown | +PASS | +
| 6e | +Description Not Enough Letters | +HIGH | +On Suggestions tab | +1. Enter "1234567890" in Description 2. Fill other fields validly 3. Submit |
+ Error: "Description must contain at least 10 letters" | +Error message shown | +PASS | +
| 6f | +Category Not Selected | +HIGH | +On Suggestions tab | +1. Fill Title and Description validly 2. Leave Category blank 3. Submit |
+ Error: "Please select a category" | +Error message shown | +PASS | +
| 6g | +Valid Input - Issue | +HIGH | +On Suggestions tab | +1. Enter valid Title and Description 2. Select "Issue" as Category 3. Submit |
+ Suggestion submitted, form clears, no errors | +Suggestion submitted, form cleared | +PASS | +
| 6h | +Valid Input - Suggestion | +HIGH | +On Suggestions tab | +1. Enter valid Title and Description 2. Select "Suggestion" as Category 3. Submit |
+ Suggestion submitted, form clears, no errors | +Suggestion submitted, form cleared | +PASS | +
| 6i | +Valid Input - Feature Request | +HIGH | +On Suggestions tab | +1. Enter valid Title and Description 2. Select "Feature Request" as Category 3. Submit |
+ Suggestion submitted, form clears, no errors | +Suggestion submitted, form cleared | +PASS | +
| 6j | +Valid Input - Other | +HIGH | +On Suggestions tab | +1. Enter valid Title and Description 2. Select "Other" as Category 3. Submit |
+ Suggestion submitted, form clears, no errors | +Suggestion submitted, form cleared | +PASS | +
| 6k | +Leading/Trailing Spaces | +MEDIUM | +On Suggestions tab | +1. Enter " Valid Title " and " Valid Description " 2. Select any Category 3. Submit |
+ Suggestion submitted, form clears, no errors | +Suggestion submitted, form cleared | +PASS | +
| 6l | +Special Characters in Title | +MEDIUM | +On Suggestions tab | +1. Enter "Hello!@#" in Title 2. Valid Description and Category 3. Submit |
+ Suggestion submitted if at least 3 letters | +Suggestion submitted | +PASS | +
| 6m | +Special Characters in Description | +MEDIUM | +On Suggestions tab | +1. Enter valid Title 2. Enter "This is a test!@#" in Description 3. Valid Category 4. Submit |
+ Suggestion submitted if at least 10 letters | +Suggestion submitted | +PASS | +
| 6n | +Title: 123@gh (Not Enough Letters) | +HIGH | +On Suggestions tab | +1. Enter "123@gh" in Title 2. Valid Description and Category 3. Submit |
+ Error: "Title must contain at least 3 letters" | +Error message shown | +PASS | +
| 6o | +Title: 123@bug (Enough Letters) | +HIGH | +On Suggestions tab | +1. Enter "123@bug" in Title 2. Valid Description and Category 3. Submit |
+ No error, suggestion submitted | +Suggestion submitted | +PASS | +
| 6p | +Description: 1234567@gh (Not Enough Letters) | +HIGH | +On Suggestions tab | +1. Enter valid Title 2. Enter "1234567@gh" in Description 3. Valid Category 4. Submit |
+ Error: "Description must contain at least 10 letters" | +Error message shown | +PASS | +
| 6q | +Description: 1234567@ghijklmnopqrst (Enough Letters) | +HIGH | +On Suggestions tab | +1. Enter valid Title 2. Enter "1234567@ghijkl" in Description 3. Valid Category 4. Submit |
+ No error, suggestion submitted | +Suggestion submitted | +PASS | +
| 7 | +Submit Valid Suggestion | +HIGH | +User is on Suggestions tab | +1. Fill all fields validly 2. Submit |
+ Suggestion is submitted, form clears, history tab updates | +Suggestion submitted, history updated | +PASS | +
| 8 | +Suggestion Appears in History | +HIGH | +User has submitted a suggestion | +1. Switch to "Your History" tab | +Submitted suggestion appears as a card with correct title, description, category, and status | +Card shown with correct info | +PASS | +
| 9 | +Category & Status Badges Render | +MEDIUM | +User has suggestions in history | +1. View suggestion cards in history | +Each card shows colored badges for category and status | +Badges rendered as expected | +PASS | +
| 10 | +Filter Suggestions by Status | +MEDIUM | +User has multiple suggestions with different statuses | +1. Use status filter dropdown 2. Select "Pending", "Approved", "Rejected" |
+ Only suggestions with selected status are shown | +Filter works for all statuses | +PASS | +
| 11 | +Filter Suggestions by Category | +MEDIUM | +User has suggestions in multiple categories | +1. Use category filter dropdown 2. Select a category |
+ Only suggestions in selected category are shown | +Category filter works | +PASS | +
| 12 | +Feedback Prompt Appears | +LOW | +User is on Suggestions tab | +1. Observe top of Suggestions section | +Feedback prompt with "Give Feedback" button is visible | +Prompt shown | +PASS | +
| 13 | +Feedback Prompt Dismiss | +LOW | +Feedback prompt is visible | +1. Click "×" on feedback prompt | +Prompt disappears | +Prompt dismissed | +PASS | +