// 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.

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);
  });
}
