fix(paises): eyebrows outside the card, country count, header search

Audit 5.4 (t4:254/260): "Tus idiomas" and "Todos" eyebrows now sit
OUTSIDE any card at title-tier (20px) padding, styled with
eyebrowLabel -- were titleMedium w900 inside a PluriGlassSurface.
"Todos" also gains its missing total count ("{title} · {count}").

Audit 5.7 (t4:252): the header gained a real `search` action -- toggles
an inline TextField that filters the country list by name or ISO
code, not a decorative no-op button. New ARB key countriesSearchHint.

Item 5.6 (station count as a subtitle line, not a trailing widget) was
already fixed as an undocumented side effect of Tier3's row rebuild
(3303bd3) -- reconfirmed by direct read, no change needed here.
This commit is contained in:
2026-07-30 16:18:44 +02:00
parent 533896b9fa
commit 94b1e901d1
2 changed files with 200 additions and 48 deletions
+64 -1
View File
@@ -4,6 +4,7 @@ import 'package:pluriwave/estado/estado_busqueda.dart';
import 'package:pluriwave/l10n/gen/app_localizations.dart';
import 'package:pluriwave/modelos/pais_radio.dart';
import 'package:pluriwave/pantallas/pantalla_paises.dart';
import 'package:pluriwave/widgets/pluri_glass_surface.dart';
import 'package:pluriwave/widgets/pluri_push_scaffold.dart';
import 'package:provider/provider.dart';
@@ -62,7 +63,9 @@ void main() {
tester.element(find.byType(PantallaPaises)),
);
expect(find.text(l10n.countriesYourLanguagesTitle), findsOneWidget);
expect(find.text(l10n.countriesAllTitle), findsOneWidget);
// Audit 5.4: "Todos" now carries the total count as part of the
// same eyebrow string ("{title} · {count}"), not a bare title.
expect(find.textContaining(l10n.countriesAllTitle), findsOneWidget);
// Full alphabetical list: all 3 fetched countries render.
expect(find.text('Argentina'), findsOneWidget);
@@ -201,6 +204,66 @@ void main() {
);
});
group('visual fidelity (audit 5.4/5.7)', () {
testWidgets(
'the section eyebrows sit OUTSIDE any card, styled as an eyebrow '
'label, and "Todos" carries the total country count (t4:254/260)',
(tester) async {
final estado = EstadoBusqueda(
radio: FakeServicioRadio(
paises: const [
PaisRadio(nombre: 'Spain', codigoIso: 'ES', numeroEmisoras: 482),
PaisRadio(
nombre: 'Argentina',
codigoIso: 'AR',
numeroEmisoras: 120,
),
PaisRadio(nombre: 'France', codigoIso: 'FR', numeroEmisoras: 75),
],
),
);
addTearDown(estado.dispose);
await tester.pumpWidget(buildScreen(estado));
await pumpEstable(tester);
final l10n = AppLocalizations.of(
tester.element(find.byType(PantallaPaises)),
);
final eyebrow = tester.widget<Text>(
find.text(l10n.countriesYourLanguagesTitle),
);
expect(eyebrow.style?.fontSize, 11);
expect(eyebrow.style?.fontWeight, FontWeight.w800);
expect(
find.ancestor(
of: find.text(l10n.countriesYourLanguagesTitle),
matching: find.byType(PluriGlassSurface),
),
findsNothing,
reason: 'the eyebrow must not be a descendant of any card',
);
expect(
find.textContaining('${l10n.countriesAllTitle} · 3'),
findsOneWidget,
);
},
);
testWidgets('the header carries a search action (t4:252)', (tester) async {
final estado = EstadoBusqueda(radio: FakeServicioRadio(paises: const []));
addTearDown(estado.dispose);
await tester.pumpWidget(buildScreen(estado));
await pumpEstable(tester);
expect(find.byIcon(Icons.search_rounded), findsOneWidget);
});
});
testWidgets(
'cargarPaises no se re-dispara si ya hay datos en caché al reconstruir',
(tester) async {