Some checks are pending
Security / Security check (push) Waiting to run
Studio is the Ch∆In product's GUI, not a F∆I-vendor app. Rename the Flutter package, all package: imports, and the build identity across platforms: linux/windows CMake BINARY_NAME + project, Windows Runner.rc fields, macOS PRODUCT_NAME / bundle id (ai.flemming.chain.chainStudio) / .app + scheme BuildableName. Update the client-SDK + flow-editor deps to their renamed chain_* packages (path + git URL). Company/copyright fields now read Flemming.AI. flutter analyze: clean. Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
52 lines
1.9 KiB
Dart
52 lines
1.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter/services.dart' show rootBundle;
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:flutter_markdown_plus/flutter_markdown_plus.dart';
|
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
|
import 'package:chain_studio/l10n/app_localizations.dart';
|
|
import 'package:chain_studio/theme/theme.dart';
|
|
|
|
/// Recreates the exact DocReaderSheet code path that
|
|
/// welcome.dart uses, including FaiTheme.markdownStyle, so a
|
|
/// regression in either rootBundle, the markdown parser, or
|
|
/// the style sheet surfaces here instead of only at runtime
|
|
/// when an operator clicks a doc card.
|
|
void main() {
|
|
TestWidgetsFlutterBinding.ensureInitialized();
|
|
|
|
testWidgets('DocReaderSheet renders all four german + english docs',
|
|
(tester) async {
|
|
final theme = FaiTheme.light();
|
|
for (final slug in ['architecture', 'security', 'audit', 'flows']) {
|
|
for (final locale in ['de', 'en']) {
|
|
final path = locale == 'de'
|
|
? 'assets/docs/${slug}_de.md'
|
|
: 'assets/docs/$slug.md';
|
|
final text = await rootBundle.loadString(path);
|
|
|
|
await tester.pumpWidget(MaterialApp(
|
|
locale: Locale(locale),
|
|
supportedLocales: const [Locale('en'), Locale('de')],
|
|
localizationsDelegates: const [
|
|
AppLocalizations.delegate,
|
|
GlobalMaterialLocalizations.delegate,
|
|
GlobalWidgetsLocalizations.delegate,
|
|
GlobalCupertinoLocalizations.delegate,
|
|
],
|
|
theme: theme,
|
|
home: Scaffold(
|
|
body: Markdown(
|
|
data: text,
|
|
padding: const EdgeInsets.all(8),
|
|
selectable: true,
|
|
styleSheet: FaiTheme.markdownStyle(theme),
|
|
),
|
|
),
|
|
));
|
|
await tester.pump();
|
|
// ignore: avoid_print
|
|
print('rendered $path');
|
|
}
|
|
}
|
|
});
|
|
}
|