feat(tokens): add design tokens, type scale, push scaffold, and root nav state

This commit is contained in:
2026-07-28 20:01:23 +02:00
parent 6dba89432e
commit 172b2a42ac
17 changed files with 856 additions and 30 deletions
+55
View File
@@ -3,7 +3,12 @@
// existe en este proyecto — corregido para usar PluriWaveApp.
// Los tests de integración completos (audio, streaming) requieren un dispositivo.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pluriwave/l10n/gen/app_localizations.dart';
import 'package:pluriwave/tema/pluriwave_theme.dart';
import 'package:pluriwave/widgets/pluri_bottom_navigation.dart';
import 'package:pluriwave/widgets/pluri_icon.dart';
void main() {
testWidgets('Placeholder — tests de integración requieren dispositivo', (
@@ -14,4 +19,54 @@ void main() {
// por el test de smoke incorrecto del boilerplate original.
expect(true, isTrue);
});
// Spec app-navigation-shell — "Escuchar Tab Rename Preserves the ARB Key"
// and "Escuchar uses the home glyph": the former "Inicio" tab is
// relabeled by changing navHome's VALUE only; PluriIconGlyph.home stays
// its icon. app.dart's real _navItems()/_paginas wiring is private to
// that library, so this pins the same two contracts at the pieces it
// composes: the ARB value, the PluriNavItem the tab is built from, and
// that PluriIconGlyph.home still resolves to a renderable icon.
group('Escuchar tab rename (WU1)', () {
test('navHome value renamed in en/es without touching the key', () async {
final l10nEs = await AppLocalizations.delegate.load(const Locale('es'));
final l10nEn = await AppLocalizations.delegate.load(const Locale('en'));
expect(l10nEs.navHome, 'Escuchar');
expect(l10nEn.navHome, 'Listen');
});
test(
'the home tab item still pairs navHome with PluriIconGlyph.home',
() async {
final l10n = await AppLocalizations.delegate.load(const Locale('es'));
final item = PluriNavItem(
glyph: PluriIconGlyph.home,
label: l10n.navHome,
);
expect(item.label, 'Escuchar');
expect(item.glyph, PluriIconGlyph.home);
},
);
testWidgets('PluriIconGlyph.home still renders as the home icon', (
tester,
) async {
await tester.pumpWidget(
MaterialApp(
theme: PluriWaveTheme.dark(),
home: const Scaffold(
body: PluriIcon(
glyph: PluriIconGlyph.home,
semanticLabel: 'Escuchar',
),
),
),
);
expect(find.bySemanticsLabel('Escuchar'), findsOneWidget);
});
});
}