Skip to content

test: add unit tests for OutreachyProjectModal#459

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

test: add unit tests for OutreachyProjectModal#459
andoriyaprashant merged 1 commit into
andoriyaprashant:mainfrom
adityashirsatrao007:test/outreachy-project-modal

Conversation

@adityashirsatrao007

Copy link
Copy Markdown
Contributor

Description

Adds comprehensive unit tests for the OutreachyProjectModal class.

Changes

  • Added test/outreachy_project_modal_test.dart with 8 test cases covering:
    • Constructor field initialization
    • copyWith() with partial and full updates
    • toMap() serialization
    • fromMap() deserialization
    • toJson() JSON encoding
    • toString() output
    • Edge case: empty skills list
    • Edge case: zero spots

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

Comprehensive unit tests for OutreachyProjectModal covering:
- Constructor field initialization
- copyWith() with partial and full updates
- toMap() serialization
- fromMap() deserialization
- toJson() JSON encoding
- toString() output
- Edge cases: empty skills list, zero spots
Copilot AI review requested due to automatic review settings May 30, 2026 10:55
@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 unit test suite to validate the behavior of OutreachyProjectModal (construction, copying, serialization, and edge cases).

Changes:

  • Introduces tests for OutreachyProjectModal constructor and copyWith.
  • Adds coverage for toMap/fromMap, toJson, and toString.
  • Includes basic edge-case tests for empty skills and zero spots.

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

Comment on lines +62 to +66
test('toJson returns valid JSON string', () {
final jsonStr = tModal.toJson();
expect(jsonStr, isA<String>());
expect(jsonStr.contains('TestProject'), isTrue);
});
Comment on lines +68 to +74
test('toString contains all fields', () {
final str = tModal.toString();
expect(str, contains('TestProject'));
expect(str, contains('Python'));
expect(str, contains('3'));
expect(str, contains('2023'));
});
@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 a52d641
🔍 Latest deploy log https://app.netlify.com/projects/aquamarine-kheer-83feda/deploys/6a1ac22912d45e000825ddf7

@andoriyaprashant andoriyaprashant merged commit fb2fda1 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