feat(studio): guided-setup wizard (reuses chain init engine)
A Welcome 'Setup assistant' button opens a wizard that collects scenario / intent / target (+ approval & data-local toggles), then calls `chain init --answers` to preview the assembled plan and `--apply --force` to write the config — reusing the Rust deterministic engine, no logic duplicated. New SystemActions.chainInit; copyable errors via showFaiProcessError; EN+DE l10n. analyze clean; smoke test + existing welcome/sidebar tests pass. Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
parent
36a8252f67
commit
c9fa068991
9 changed files with 509 additions and 0 deletions
30
test/guided_setup_test.dart
Normal file
30
test/guided_setup_test.dart
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
// Smoke test for the guided-setup wizard: it mounts and renders its
|
||||
// first step (three choice dropdowns) without touching the CLI. The
|
||||
// `chain init` shell-out only happens on Next/Apply, so mounting is
|
||||
// side-effect-free and safe to assert in a widget test.
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:chain_studio/l10n/app_localizations.dart';
|
||||
import 'package:chain_studio/widgets/guided_setup_dialog.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('guided setup wizard mounts and shows the first step',
|
||||
(tester) async {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
locale: const Locale('en'),
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
home: const Scaffold(body: GuidedSetupDialog()),
|
||||
),
|
||||
);
|
||||
await tester.pump();
|
||||
|
||||
// Title from l10n + the three scenario/intent/target dropdowns.
|
||||
expect(find.text('Setup assistant'), findsWidgets);
|
||||
expect(find.byType(DropdownButton<String>), findsNWidgets(3));
|
||||
// The "Next" action is present (advances to the review/apply step).
|
||||
expect(find.widgetWithText(FilledButton, 'Next'), findsOneWidget);
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue