import 'package:flutter/cupertino.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:sign_checker/data/catalog/bundled_sign_catalog.dart'; import 'package:sign_checker/presentation/catalog/catalog_page.dart'; import 'package:sign_checker/presentation/catalog/sign_detail_page.dart'; void main() { setUpAll(() { GoogleFonts.config.allowRuntimeFetching = false; }); testWidgets('catalog opens the sign and shows the driver action', ( tester, ) async { await tester.pumpWidget(const CupertinoApp(home: CatalogPage())); await tester.enterText(find.byType(CupertinoTextField), '3.27'); await tester.pump(); expect(find.text('Остановка запрещена'), findsOneWidget); await tester.tap(find.text('Остановка запрещена')); await tester.pumpAndSettle(); expect(find.text('ЧТО ДЕЛАТЬ'), findsOneWidget); expect(find.textContaining('Не останавливайтесь'), findsOneWidget); }); testWidgets('detail page warns when the sign face carries the number', ( tester, ) async { final sign = bundledSignCatalog.findByCode('3.24')!; await tester.pumpWidget( CupertinoApp(home: SignDetailPage(sign: sign)), ); expect(find.textContaining('цифру и схему'), findsOneWidget); }); }