merge: incorporate main's safearea/auto-order/vacaciones fixes
This commit is contained in:
@@ -2741,7 +2741,15 @@ void main() {
|
||||
});
|
||||
|
||||
group('ConstructorArbolAuto.hijos', () {
|
||||
test('limita a 50 items y respeta el orden de ordenarEmisoras', () {
|
||||
test('limita a 50 items y PRESERVA el orden recibido — item 2 '
|
||||
'(android-auto-orden fix): ya no reordena por calidad. Cada llamador '
|
||||
'(Favoritos/Todas/Mis emisoras) empuja el snapshot ya en el orden que '
|
||||
'el teléfono usa (orden manual o el ajuste global ordenListas), así '
|
||||
'que reordenar aquí volvería a descartarlo', () {
|
||||
// bitrate ascendente a propósito: si hijos() todavía reordenara por
|
||||
// calidad (bitrate descendente), el primero sería uuid-59, no
|
||||
// uuid-0 — esta es la diferencia que distingue "preserva el orden"
|
||||
// de "vuelve a ordenar".
|
||||
final emisoras = List.generate(
|
||||
60,
|
||||
(i) => _emisora(uuid: 'uuid-$i', nombre: 'Radio $i', bitrate: i),
|
||||
@@ -2753,11 +2761,8 @@ void main() {
|
||||
);
|
||||
|
||||
expect(hijos, hasLength(50));
|
||||
// ordenarEmisoras por calidad ordena por bitrate descendente: el
|
||||
// primer item debe ser el de mayor bitrate (59) y el ultimo (el #50)
|
||||
// el de bitrate 10 (59..10 son 50 valores).
|
||||
expect(hijos.first.id, 'emisora:uuid-59');
|
||||
expect(hijos.last.id, 'emisora:uuid-10');
|
||||
expect(hijos.first.id, 'emisora:uuid-0');
|
||||
expect(hijos.last.id, 'emisora:uuid-49');
|
||||
});
|
||||
|
||||
test('lista vacía cuando no hay emisoras, sin lanzar', () {
|
||||
@@ -2935,8 +2940,9 @@ void main() {
|
||||
});
|
||||
|
||||
group('ConstructorArbolAuto.hijosGrupo', () {
|
||||
test('filtra por grupoFavoritosId, ordena y capea a 50; id desconocido '
|
||||
'devuelve lista vacía', () {
|
||||
test('filtra por grupoFavoritosId, PRESERVA el orden recibido (ya no '
|
||||
'reordena por calidad — item 2 android-auto-orden fix) y capea a 50; '
|
||||
'id desconocido devuelve lista vacía', () {
|
||||
final favoritos = List.generate(
|
||||
60,
|
||||
(i) => _emisora(
|
||||
@@ -2953,8 +2959,8 @@ void main() {
|
||||
);
|
||||
|
||||
expect(hijos, hasLength(50));
|
||||
expect(hijos.first.id, 'emisora:uuid-59');
|
||||
expect(hijos.last.id, 'emisora:uuid-10');
|
||||
expect(hijos.first.id, 'emisora:uuid-0');
|
||||
expect(hijos.last.id, 'emisora:uuid-49');
|
||||
|
||||
final vacio = ConstructorArbolAuto().hijosGrupo(
|
||||
'grupo:g-inexistente',
|
||||
|
||||
Reference in New Issue
Block a user