// Author: fruit.com.cn import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:fruitshorts/l10n/app_localizations.dart'; import 'package:fruitshorts/pages/player/widgets/quality_sheet.dart'; void main() { testWidgets('should_list_every_returned_quality_when_sheet_opens', ( tester, ) async { await tester.pumpWidget( MaterialApp( locale: const Locale('en'), localizationsDelegates: AppLocalizations.localizationsDelegates, supportedLocales: AppLocalizations.supportedLocales, home: const Scaffold( body: QualitySheet(qualities: ['AUTO', '720P', '1080P']), ), ), ); expect(find.text('Auto'), findsOneWidget); expect(find.text('720P'), findsOneWidget); expect(find.text('1080P'), findsOneWidget); expect(find.byIcon(Icons.check_rounded), findsOneWidget); expect( find.text('HLS adjusts the bitrate automatically for your connection.'), findsOneWidget, ); }); }