// Smoke test for the Beta UI banners. Verifies the // non-production-ready banner appears in both supported locales. // // Does NOT call into the FRB Rust side; that requires the cdylib at // runtime and is verified by alpha_e2e_test.dart + beta_e2e_test.dart. // // Requirement trace (SWE.4 unit verification — banner widget): // SRS-165..SRS-169 (localization), SRS-170..SRS-176 (Unicode / server content), // SAD-014 (design-system + localization integration), // SDD-031, SDD-032, SDD-033, SDD-034 (localization fallback + product-vs-server text). // Verification-plan rows: SWE4-UV-014, SWE4-UV-019, SWE4-UV-020 (swe4-unit-verification-plan.md). import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:chanora_flutter/l10n/generated/app_localizations.dart'; void main() { testWidgets('renders English banner', (tester) async { await tester.pumpWidget(MaterialApp( localizationsDelegates: AppL10n.localizationsDelegates, supportedLocales: AppL10n.supportedLocales, home: Builder(builder: (ctx) { final l10n = AppL10n.of(ctx); return Scaffold(body: Text(l10n.homeNotProductionReadyBanner)); }), )); await tester.pumpAndSettle(); expect(find.textContaining('Beta build'), findsOneWidget); }); testWidgets('renders Simplified Chinese banner', (tester) async { await tester.pumpWidget(MaterialApp( locale: const Locale('zh'), localizationsDelegates: AppL10n.localizationsDelegates, supportedLocales: AppL10n.supportedLocales, home: Builder(builder: (ctx) { final l10n = AppL10n.of(ctx); return Scaffold(body: Text(l10n.homeNotProductionReadyBanner)); }), )); await tester.pumpAndSettle(); expect(find.textContaining('Beta 版本'), findsOneWidget); }); }