import 'package:flutter/foundation.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:halkyon_train_flutter/src/app/licences.dart'; void main() { testWidgets( "Lucide's notice, whose icon is Train's, joins the licence list", ( tester, ) async { registerLucideLicense(); final entries = await tester.runAsync( () => LicenseRegistry.licenses.toList(), ); final lucide = entries!.where( (entry) => entry.packages.contains('Lucide (the app icon)'), ); expect(lucide, isNotEmpty); expect( lucide.first.paragraphs.map((paragraph) => paragraph.text).join('\n'), contains('ISC License'), ); }, ); testWidgets("Polar's notices, whose SDK the Loop goes through, join the " 'licence list', (tester) async { registerPolarLicense(); final entries = await tester.runAsync( () => LicenseRegistry.licenses.toList(), ); final polar = entries! .where( (entry) => entry.packages.contains( "Polar BLE SDK (the Polar Loop's connection)", ), ) .map( (entry) => entry.paragraphs.map((paragraph) => paragraph.text).join('\n'), ) .toList(); expect(polar, hasLength(2)); expect(polar.first, contains('SOFTWARE DEVELOPMENT KIT LIMITED LICENSE')); expect(polar.last, contains('Protocol Buffers')); }); }