feat(buscar): add discovery landing state, filter pills, counter, and sort
This commit is contained in:
@@ -373,6 +373,45 @@ void main() {
|
||||
});
|
||||
});
|
||||
|
||||
group('EstadoRadio orden de listas — persistencia (WU6)', () {
|
||||
// Correction applied at apply time: cambiarOrdenListas'/_cargarOrdenListas
|
||||
// round-trip had zero test coverage before WU6 added OrdenEmisoras.
|
||||
// popularidad — a latent gap similar to WU5's androidAudioSessionIdStream
|
||||
// discovery. Adding a new enum case without covering the persistence
|
||||
// switch would have shipped a silent revert-to-calidad-on-restart bug.
|
||||
test(
|
||||
'popularidad persiste y sobrevive a una nueva instancia (reinicio)',
|
||||
() async {
|
||||
final estadoUno = EstadoRadio(
|
||||
audio: FakeServicioAudio(),
|
||||
favoritos: FakeServicioFavoritos(),
|
||||
radio: FakeServicioRadio(),
|
||||
servicioEcualizador: FakeServicioEcualizador(),
|
||||
resolverArchivoCustom: _archivoCustomVacio,
|
||||
iniciarAutomaticamente: false,
|
||||
);
|
||||
await estadoUno.inicializar();
|
||||
|
||||
await estadoUno.cambiarOrdenListas(OrdenEmisoras.popularidad);
|
||||
expect(estadoUno.ordenListas, OrdenEmisoras.popularidad);
|
||||
|
||||
// Fresh instance, same (mocked) SharedPreferences-backed store —
|
||||
// simulates an app restart re-reading the persisted preference.
|
||||
final estadoDos = EstadoRadio(
|
||||
audio: FakeServicioAudio(),
|
||||
favoritos: FakeServicioFavoritos(),
|
||||
radio: FakeServicioRadio(),
|
||||
servicioEcualizador: FakeServicioEcualizador(),
|
||||
resolverArchivoCustom: _archivoCustomVacio,
|
||||
iniciarAutomaticamente: false,
|
||||
);
|
||||
await estadoDos.inicializar();
|
||||
|
||||
expect(estadoDos.ordenListas, OrdenEmisoras.popularidad);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
group(
|
||||
'EstadoRadio — emisoras custom: lectura tolerante y guardia de '
|
||||
'degradacion (persistence-resilience)',
|
||||
|
||||
Reference in New Issue
Block a user