import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:im_webview_app/config/app_config.dart'; import 'package:im_webview_app/main.dart'; void main() { test('creates the WebView shell app widget', () { expect( const ImWebViewApp(shellBranding: ShellBranding.fallback), isA(), ); }); test('passes shell branding name and logo to the H5 URL', () { const logo = 'data:image/png;base64,abc+/='; final uri = Uri.parse( AppConfig.homeUrl(appName: 'Shell Test', appLogo: logo), ); expect(uri.queryParameters['flutter_shell'], '1'); expect(uri.queryParameters['shell_app_name'], 'Shell Test'); expect(uri.queryParameters.containsKey('shell_app_logo'), isFalse); expect(uri.toString(), isNot(contains('%25'))); expect(Uri.splitQueryString(uri.fragment)['shell_app_logo'], logo); }); }