chain-studio/test/widget_test.dart
flemming-it 4352ecc28c feat(ui): add Doctor page (4th destination) — full health snapshot
Composes the platform's health picture in one view:
- Summary strip: 4 stat tiles for modules / approvals / audit
  chain / services with semantic accent colour.
- Event-log panel: WORM-1 badge + chain status, points to the
  first tampered event id when integrity fails.
- Modules & approvals panel: counts plus an "attention" pill
  when approvals are pending.
- Services panel: declared services from operator config or a
  helpful empty-state pointing at ~/.fai/config.yaml.

Backed by the new HubAdmin RPCs (VerifyEventChain, ListServices)
plus the existing ListCapabilities and ListApprovals. One
HubService.doctor() call fans out to all four in parallel.

Doctor is the new first destination in the sidebar — that's the
page an operator wants to land on after starting the app.

Bumps fai_studio 0.3.0 -> 0.4.0.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
2026-05-05 22:09:49 +02:00

27 lines
1 KiB
Dart

// Smoke test: app boots without crashing and shows the three
// MVP destinations in the navigation rail.
//
// Pages themselves now make live gRPC calls. We pump only one
// frame so they enter the loading state without actually
// awaiting the connection (which would fail without a running
// hub in CI).
import 'package:flutter_test/flutter_test.dart';
import 'package:fai_studio/main.dart';
void main() {
testWidgets('Studio shell shows the four destinations',
(tester) async {
await tester.pumpWidget(const StudioApp());
expect(find.text('F∆I Studio'), findsOneWidget);
// "Doctor" appears twice (sidebar label + app bar title of the
// first selected page) — same for "Modules" / "Audit" /
// "Approvals" once their pages are first visited. We just check
// the labels are findable at all.
expect(find.text('Doctor'), findsWidgets);
expect(find.text('Modules'), findsWidgets);
expect(find.text('Audit'), findsWidgets);
expect(find.text('Approvals'), findsWidgets);
});
}