Skip to content

256 games unit tests - #267

Merged
juva99 merged 6 commits into
mainfrom
256-fields-and-games-test
Jul 28, 2025
Merged

256 games unit tests#267
juva99 merged 6 commits into
mainfrom
256-fields-and-games-test

Conversation

@YuvalOvadia1

Copy link
Copy Markdown
Collaborator

No description provided.

@YuvalOvadia1 YuvalOvadia1 linked an issue Jul 28, 2025 that may be closed by this pull request
@YuvalOvadia1 YuvalOvadia1 changed the title 256 fields and games test 256 games unit tests Jul 28, 2025
@github-actions

Copy link
Copy Markdown

🚀 Frontend Preview Deployment

Your frontend changes have been deployed to a preview environment:

Preview URL:
https://yoop-frontend-pr-267.grayfield-971e3e42.westeurope.azurecontainerapps.io

This preview will be automatically deleted when the PR is closed or merged.


Preview for commit: 941b2bd

@juva99
juva99 requested a review from Copilot July 28, 2025 17:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds comprehensive unit tests for the games service in the backend and removes unused group picture functionality from the frontend. The tests cover all major methods of the GamesService with various scenarios including success cases, error conditions, and edge cases.

Key Changes

  • Added extensive unit test coverage for the GamesService with 650+ lines of test code
  • Removed unused group picture field from group creation form and schema
  • Added necessary type dependencies for enhanced testing capabilities

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

File Description
backend/src/games/games.service.spec.ts New comprehensive test suite for GamesService covering all major methods with mocks and edge cases
frontend/app/lib/schemas/new-group.schema.ts Removed unused groupPicture field and duplicate schema definition
frontend/app/components/groups/GroupForm.tsx Removed group picture upload functionality and improved form validation behavior
backend/package.json Added type definitions for testing dependencies (aria-query, jsdom, tough-cookie)
Files not reviewed (1)
  • backend/package-lock.json: Language not supported
Comments suppressed due to low confidence (2)

backend/src/games/games.service.spec.ts:21

  • [nitpick] Test suite description should follow consistent naming convention. Consider using 'GamesService' (PascalCase) to match the class name being tested.
describe('gamesService', () => {

backend/src/games/games.service.spec.ts:92

  • [nitpick] The enum value 'FootBall' uses inconsistent casing. Consider using 'FOOTBALL' or 'Football' to match standard enum naming conventions.
    gameType: GameType.FootBall,

temp_c: '18.5',
};

const user: User = {

Copilot AI Jul 28, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Large mock objects like this User entity could be extracted to a separate test utilities file or factory functions to improve maintainability and reusability across test files.

Copilot uses AI. Check for mistakes.
@juva99
juva99 merged commit 06d73b5 into main Jul 28, 2025
3 checks passed
@juva99
juva99 deleted the 256-fields-and-games-test branch July 28, 2025 17:56
@github-actions

Copy link
Copy Markdown

🧹 Preview Environment Cleaned Up

The preview environment for this PR has been successfully deleted.


Cleanup completed for PR #267

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fields and games test

4 participants