import 'package:flutter_test/flutter_test.dart'; import 'package:farolero/modelos/usuario.dart'; void main() { group('Usuario', () { test('should create Usuario with id and nombre', () { final usuario = Usuario(id: 'test-id', nombre: 'Juan'); expect(usuario.id, 'test-id'); expect(usuario.nombre, 'Juan'); }); test('should serialize to JSON correctly', () { final usuario = Usuario(id: 'test-id', nombre: 'Juan'); final json = usuario.toJson(); expect(json['id'], 'test-id'); expect(json['nombre'], 'Juan'); }); test('should deserialize from JSON correctly', () { final json = {'id': 'test-id', 'nombre': 'Juan'}; final usuario = Usuario.fromJson(json); expect(usuario.id, 'test-id'); expect(usuario.nombre, 'Juan'); }); test('should handle JSON with avatar field', () { final json = {'id': 'test-id', 'nombre': 'Juan', 'avatar': '👤'}; final usuario = Usuario.fromJson(json); expect(usuario.id, 'test-id'); expect(usuario.nombre, 'Juan'); }); }); }