Skip to content

test: add unit tests for FossasiaProjectModal#464

Merged
andoriyaprashant merged 1 commit into
andoriyaprashant:mainfrom
adityashirsatrao007:test/fossasia-project-modal
Jun 3, 2026
Merged

test: add unit tests for FossasiaProjectModal#464
andoriyaprashant merged 1 commit into
andoriyaprashant:mainfrom
adityashirsatrao007:test/fossasia-project-modal

Conversation

@adityashirsatrao007

Copy link
Copy Markdown
Contributor

Description

Adds comprehensive unit tests for the FossasiaProjectModal class.

Changes

  • Added test/fossasia_project_model_test.dart with tests covering:
    • Constructor field initialization
    • copyWith() with partial and full updates
    • toMap() serialization
    • fromMap() deserialization
    • toJson()/fromJson() encoding and round-trip
    • Equality operator (==) and hashCode
    • toString() output
    • Edge cases: empty techstack and category lists

Related Issue

Contributes to #417 (improving test coverage and code quality)

Type of Change

  • New feature (adding tests)

Checklist

  • Tests pass locally
  • Code follows project style guidelines

Copilot AI review requested due to automatic review settings May 30, 2026 10:57
@netlify

netlify Bot commented May 30, 2026

Copy link
Copy Markdown

Deploy Preview for aquamarine-kheer-83feda failed. Why did it fail? →

Name Link
🔨 Latest commit b351ca1
🔍 Latest deploy log https://app.netlify.com/projects/aquamarine-kheer-83feda/deploys/6a1ac289bb43d70008aa797b

@github-actions

Copy link
Copy Markdown

Thank you for submitting your pull request! We'll review it as soon as possible.

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

Note

Copilot was unable to run its full agentic suite in this review.

Adds a new Flutter test suite for FOSSASIAProjectModel, validating core model behaviors (construction, JSON (de)serialization, and string formatting).

Changes:

  • Introduces unit tests for the standard constructor and toString().
  • Adds fromJson coverage for TechStack as both List and String, and Year as int.
  • Adds toJson coverage to verify output key/value mapping.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1,110 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:opso/modals/fossasia_project_modal.dart';
group('FOSSASIAProjectModel Tests', () {
const String testName = 'OpSo';
const String testDescription = 'Open Source Programs App';
final List<String> testTechStack = ['Flutter', 'Dart'];
@andoriyaprashant andoriyaprashant merged commit 6603d5c into andoriyaprashant:main Jun 3, 2026
1 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants