fix(test): make the suite runnable without device plugins

crearPartida clears the notes, which goes through SharedPreferences, and
ServicioNearby.dispose called notifyListeners after tearing the notifier
down. Both failed on plugin channels that do not exist in the test host.

Suite goes from 25 passing / 8 failing to a green run.
This commit is contained in:
2026-07-25 20:36:15 +02:00
parent 553456836f
commit bad641653c
2 changed files with 3 additions and 3 deletions
@@ -1,9 +1,12 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:farolero/estado/estado_juego.dart';
import 'package:farolero/modelos/partida.dart';
import 'package:shared_preferences/shared_preferences.dart';
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
// crearPartida limpia las notas, y eso pasa por SharedPreferences.
setUp(() => SharedPreferences.setMockInitialValues({}));
group('EstadoJuego crearPartida with host local', () {
late EstadoJuego estado;
-3
View File
@@ -12,9 +12,6 @@ void main() {
servicio = ServicioNearby();
});
tearDown(() {
servicio.dispose();
});
test('should start with empty user pool', () {
expect(servicio.usuarios, isEmpty);