Files
pluriwave/test/pantallas/pantalla_alarmas_fecha_test.dart
T
FreeTLab 202bef3539 feat(ui): design token discipline, accessibility and i18n pass
- Replace all hardcoded Color literals outside lib/tema with theme tokens (new static brand palette in PluriWaveTokens); media notification uses the brand color instead of the Material default purple
- Favorite button on station cards grows to a 48dp target and becomes an independent semantics node for screen readers (Semantics container fix)
- All flutter_animate call sites route through the PluriAnimate reduced-motion gate (zero direct .animate() left)
- Locale-aware short dates via intl DateFormat (new lib/l10n/formato_fechas.dart) replacing the hardcoded DD/MM/YYYY; proper plural messages for the favorites counter; example stream URL as a localized key - all 13 locales
- Rounded shimmer placeholders matching card radii; shimmer loading state in search instead of a bare spinner; rounded icon variants unified in settings; bottom-sheet conventions on the custom station form
- Fix latent debug crash: vacation editor read AppLocalizations in initState
- 11 new tests (121 total green), flutter analyze clean
2026-06-11 23:42:16 +02:00

28 lines
860 B
Dart

import 'package:flutter_test/flutter_test.dart';
import 'package:intl/date_symbol_data_local.dart';
import 'package:intl/intl.dart';
import 'package:pluriwave/l10n/formato_fechas.dart';
/// S5-R4: short dates must follow the active locale, not a hardcoded
/// DD/MM/YYYY pattern.
void main() {
test('en-US usa el orden mes/día, no el formato fijo DD/MM/YYYY', () {
final fecha = DateTime(2026, 6, 11);
final resultado = fechaCortaLocalizada('en-US', fecha);
expect(resultado, DateFormat.yMd('en-US').format(fecha));
expect(resultado, isNot('11/06/2026'));
expect(resultado, '6/11/2026');
});
test('es usa el orden día/mes', () async {
await initializeDateFormatting('es');
final fecha = DateTime(2026, 6, 11);
expect(
fechaCortaLocalizada('es', fecha),
DateFormat.yMd('es').format(fecha),
);
});
}