import 'package:flutter_test/flutter_test.dart'; import 'package:tm_app/data/services/model/feedback_request/feedback_request.dart'; void main() { group('FeedbackRequest Tests', () { test('fromJson should parse JSON correctly', () { final json = { 'feedback_type': 'positive', 'tender_id': 'TND123', }; final request = FeedbackRequest.fromJson(json); expect(request.feedbackType, 'positive'); expect(request.tenderId, 'TND123'); }); test('toJson should return valid JSON map', () { const request = FeedbackRequest( feedbackType: 'negative', tenderId: 'TND999', ); final json = request.toJson(); expect(json, isA>()); expect(json['feedback_type'], 'negative'); expect(json['tender_id'], 'TND999'); }); test('copyWith should modify specific fields only', () { const request = FeedbackRequest( feedbackType: 'neutral', tenderId: 'TND111', ); final updated = request.copyWith( feedbackType: 'positive', ); expect(updated.feedbackType, 'positive'); expect(updated.tenderId, 'TND111'); }); test('fromJson -> toJson round-trip should preserve data', () { final json = { 'feedback_type': 'positive', 'tender_id': 'TND001', }; final request = FeedbackRequest.fromJson(json); final output = request.toJson(); expect(output['feedback_type'], 'positive'); expect(output['tender_id'], 'TND001'); }); }); }