Skip to content

test: add unit tests for RsocProjectModal#456

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

test: add unit tests for RsocProjectModal#456
andoriyaprashant merged 1 commit into
andoriyaprashant:mainfrom
adityashirsatrao007:test/rsoc-project-modal

Conversation

@adityashirsatrao007

Copy link
Copy Markdown
Contributor

Description

Adds comprehensive unit tests for the RsocProjectModal class.

Changes

  • Added test/rsoc_project_modal_test.dart with 6 test cases covering:
    • Constructor field initialization
    • fromJson() deserialization
    • toJson() serialization
    • toJson/fromJson round-trip symmetry
    • toString() output
    • Edge case: empty string fields

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 RsocProjectModal covering:
- Constructor field initialization
- fromJson() deserialization
- toJson() serialization
- toJson/fromJson round-trip symmetry
- toString() output
- Edge case: empty string fields
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.

@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 b2279d9
🔍 Latest deploy log https://app.netlify.com/projects/aquamarine-kheer-83feda/deploys/6a1ac21870581800087ed572

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 unit tests for the RsocProjectModal class to verify constructor, JSON serialization/deserialization, toString, and handling of empty fields.

Changes:

  • New test file covering RsocProjectModal behavior.
  • Tests symmetric toJson/fromJson round-trip.
  • Tests support for empty string fields.

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

Comment on lines +51 to +57
test('toString contains all fields', () {
final str = tModal.toString();
expect(str, contains('TestProject'));
expect(str, contains('Alice'));
expect(str, contains('A test RSOC project'));
expect(str, contains('https://github.com/test/rsoc'));
});
Comment on lines +59 to +68
test('supports empty string fields', () {
final modal = RsocProjectModal(
name: '',
contributor: '',
description: '',
githubUrl: '',
);
expect(modal.name, '');
expect(modal.contributor, '');
});
@andoriyaprashant andoriyaprashant merged commit 34240d7 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