// Maintainer transparency in the store (decision-maker finding // class): the detail sheet always answers "who maintains this?" — // with the index's list, or an honest "not specified" — and the // install trust gate carries the same fact when present. import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:chain_studio/data/hub.dart'; import 'package:chain_studio/l10n/app_localizations.dart'; import 'package:chain_studio/pages/store.dart' show StoreMaintainersSection; import 'package:chain_studio/widgets/chain_install_confirm.dart'; Widget _host(Widget child) => MaterialApp( localizationsDelegates: AppLocalizations.localizationsDelegates, supportedLocales: AppLocalizations.supportedLocales, locale: const Locale('de'), home: Scaffold(body: SingleChildScrollView(child: child)), ); StoreItem _item({List maintainers = const []}) => StoreItem( name: 'text.extract', taglineEn: '', taglineDe: '', descriptionEn: '', descriptionDe: '', category: 'text', tags: const [], requiresCapabilities: const [], requiresServices: const [], license: 'Apache-2.0', repository: '', bestVersion: '0.1.0', status: 'alpha', installed: false, featured: false, iconUrl: '', screenshotUrls: const [], docsUrl: '', kind: 'native', provider: '', source: 'bundled', maintainers: maintainers, ); void main() { testWidgets('lists every maintainer on its own selectable line', ( tester, ) async { await tester.pumpWidget( _host( const StoreMaintainersSection( maintainers: [ 'Jane Doe (Example Org) ', 'John Roe ', ], ), ), ); expect( find.text('Jane Doe (Example Org) '), findsOneWidget, ); expect(find.text('John Roe '), findsOneWidget); expect(find.text('nicht angegeben'), findsNothing); }); testWidgets('an empty list renders the honest fallback', (tester) async { await tester.pumpWidget( _host(const StoreMaintainersSection(maintainers: [])), ); expect(find.text('MAINTAINER'), findsOneWidget); expect(find.text('nicht angegeben'), findsOneWidget); }); testWidgets('the trust gate names the maintainers when present', ( tester, ) async { await tester.pumpWidget( _host( ChainInstallConfirmDialog( item: _item(maintainers: ['Jane Doe ']), ), ), ); await tester.pumpAndSettle(); expect(find.text('Jane Doe '), findsOneWidget); }); testWidgets('the trust gate stays terse without maintainer data', ( tester, ) async { await tester.pumpWidget(_host(ChainInstallConfirmDialog(item: _item()))); await tester.pumpAndSettle(); expect(find.text('Maintainer'), findsNothing); }); }