Skip to content
Merged

Dev #307

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9715bd4
Add session test results for 2025-07-17 with detailed execution summa…
AdeepaK2 Jul 17, 2025
d89199d
Refactor code structure for improved readability and maintainability
AdeepaK2 Jul 17, 2025
9e43e9c
Add HTML test results for Notification System with detailed execution…
AdeepaK2 Jul 17, 2025
9c8e19c
feat(feedback): implement feedback system with schema, API, and form
SamFaMH Jul 17, 2025
dce10f9
Merge pull request #288 from Code102SoftwareProject/main
SamFaMH Jul 17, 2025
8d75519
Merge branch 'feat/user-feedback-form-samha' of https://github.com/Co…
SamFaMH Jul 17, 2025
33ee427
Merge pull request #289 from Code102SoftwareProject/feat/user-feedbac…
SamFaMH Jul 17, 2025
322a7af
Add detailed HTML test results for Meeting System with execution outc…
AdeepaK2 Jul 17, 2025
ea1e3b1
feat: Add message decryption and formatting for sidebar display
AdeepaK2 Jul 17, 2025
58067ad
Merge pull request #295 from Code102SoftwareProject/test-Adeepa
AdeepaK2 Jul 17, 2025
4f4ebec
feat: Add react-hook-form and resolvers dependencies
AdeepaK2 Jul 17, 2025
3eaa7e8
refactor: Update message handling to remove client-side encryption
AdeepaK2 Jul 17, 2025
6f7022c
fix: Correct typo in header text from "What You Want to Learn" to "Wh…
AdeepaK2 Jul 17, 2025
f9ca139
feat: Enhance meeting notes functionality and cleanup processes
AdeepaK2 Jul 17, 2025
c4e11aa
fix: Update error message for user information loading failure
AdeepaK2 Jul 17, 2025
3410e71
feat: Enhance meeting fetching logic and improve PATCH request handli…
AdeepaK2 Jul 17, 2025
705c0e6
feat: Add saved meeting notes functionality and improve meeting list …
AdeepaK2 Jul 17, 2025
e1959bc
feat: Implement automatic meeting cleanup with TTL index and add CI w…
AdeepaK2 Jul 18, 2025
ddcc604
refactor: Remove TypeScript check from CI workflows and update layout…
AdeepaK2 Jul 18, 2025
6a28fdb
refactor: Remove PR comment actions from CI workflow and update Testi…
AdeepaK2 Jul 18, 2025
48714fe
Merge pull request #300 from Code102SoftwareProject/test-Adeepa
AdeepaK2 Jul 18, 2025
56ec17c
feat: Enhance DailyMeeting component with improved error handling and…
AdeepaK2 Jul 18, 2025
cf395c1
refactor: Remove Daily Badge Assignment workflow from CI configuration
AdeepaK2 Jul 18, 2025
7f5e9cb
Merge pull request #302 from Code102SoftwareProject/test-Adeepa
AdeepaK2 Jul 18, 2025
c64ba05
feat(test): add manual test cases and unit test
SamFaMH Jul 18, 2025
318979a
Merge pull request #304 from Code102SoftwareProject/dev
SamFaMH Jul 18, 2025
3915b12
Merge branch 'test-samha' of https://github.com/Code102SoftwareProjec…
SamFaMH Jul 18, 2025
909c8b5
Merge pull request #306 from Code102SoftwareProject/test-samha
SamFaMH Jul 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions .github/workflows/badge-assignment.yml

This file was deleted.

119 changes: 119 additions & 0 deletions .github/workflows/ci-build-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: CI - Build and Test

on:
# Trigger on pull requests to main branch
pull_request:
branches: [ main, master ]

# Trigger on pushes to main branch (merges)
push:
branches: [ main, master ]

# Allow manual trigger
workflow_dispatch:

jobs:
build-and-test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test
continue-on-error: false
env:
CI: true

- name: Build application
run: npm run build
continue-on-error: false
env:
CI: true

- name: Check build output
run: |
if [ ! -d ".next" ]; then
echo "Build failed - .next directory not found"
exit 1
fi
echo "Build successful - .next directory exists"

- name: Upload build artifacts (on failure)
if: failure()
uses: actions/upload-artifact@v4
with:
name: build-logs-${{ matrix.node-version }}
path: |
.next/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
retention-days: 5

# Additional job for documentation build (if needed)
build-docs:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'

- name: Install main dependencies
run: npm ci

- name: Install documentation dependencies
run: |
cd documentation
npm ci

- name: Build documentation
run: |
cd documentation
npm run build
continue-on-error: false

# Security and quality checks
security-audit:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run security audit
run: npm audit --audit-level=high
continue-on-error: true

- name: Check for outdated packages
run: npm outdated || true
32 changes: 32 additions & 0 deletions .github/workflows/pr-quality-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: PR Quality Check

on:
pull_request:
types: [opened, synchronize, reopened]

permissions:
contents: read
pull-requests: write
issues: write

jobs:
quick-check:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build check
run: npm run build
env:
CI: true
89 changes: 89 additions & 0 deletions __tests__/components/userDashboard/UserDashboardContent.test.tsx
Original file line number Diff line number Diff line change
@@ -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 = () => <div data-testid="UserSkills" />;
MockUserSkills.displayName = 'MockUserSkills';
return MockUserSkills;
});
jest.mock('@/components/Dashboard/SkillsRequested', () => ({
SkillsRequested: () => <div data-testid="SkillsRequested" />,
SkillsOffered: () => <div data-testid="SkillsOffered" />
}));
jest.mock('@/components/Dashboard/ReviewSummary', () => ({
ReviewSummary: () => <div data-testid="ReviewSummary" />
}));
jest.mock('@/components/Dashboard/EarnedBadges', () => {
const MockEarnedBadges = () => <div data-testid="EarnedBadges" />;
MockEarnedBadges.displayName = 'MockEarnedBadges';
return MockEarnedBadges;
});

jest.mock('@/components/Dashboard/ProfileCard', () => {
const MockProfileCard = () => <div data-testid="ProfileCard" />;
MockProfileCard.displayName = 'MockProfileCard';
return MockProfileCard;
});
jest.mock('@/components/Dashboard/TimeSpentChart', () => ({
TimeSpentChart: () => <div data-testid="TimeSpentChart" />
}));
jest.mock('@/components/Dashboard/SkillMatchOverview', () => {
const MockSkillMatchOverview = () => <div data-testid="SkillMatchOverview" />;
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(
<UserDashboardContent
onNavigateToMySkills={jest.fn()}
onNavigateToReviews={jest.fn()}
/>
);

expect(screen.getByText(/Hi Samha fathima, Welcome back!/i)).toBeInTheDocument();
});

it('renders all child components when user is present', () => {
render(
<UserDashboardContent
onNavigateToMySkills={jest.fn()}
onNavigateToReviews={jest.fn()}
/>
);

expect(screen.getByTestId('UserSkills')).toBeInTheDocument();
expect(screen.getByTestId('SkillsRequested')).toBeInTheDocument();
expect(screen.getByTestId('SkillsOffered')).toBeInTheDocument();
expect(screen.getByTestId('ReviewSummary')).toBeInTheDocument();
expect(screen.getByTestId('EarnedBadges')).toBeInTheDocument();
expect(screen.getByTestId('ProfileCard')).toBeInTheDocument();
expect(screen.getByTestId('TimeSpentChart')).toBeInTheDocument();
expect(screen.getByTestId('SkillMatchOverview')).toBeInTheDocument();
});
});
Loading
Loading