askrobots / dbbasic-scroll
Public
Scroll: the Flutter operator console for the DBBASIC Object Server, for people building alongside AI agents.
smoke_test.dart · 1.4 KB · 38 lines
| 1 | import 'package:integration_test/integration_test.dart'; |
| 2 | import 'package:flutter_test/flutter_test.dart'; |
| 3 | import 'package:flutter/material.dart'; |
| 4 | import 'package:dbbasic_scroll/main.dart' as app; |
| 5 | |
| 6 | void main() { |
| 7 | IntegrationTestWidgetsFlutterBinding.ensureInitialized(); |
| 8 | |
| 9 | testWidgets('App launches and shows either connect or main screen', (tester) async { |
| 10 | app.main(); |
| 11 | await tester.pumpAndSettle(const Duration(seconds: 3)); |
| 12 | |
| 13 | // Should show either the connect screen OR the main shell (if auto-connected) |
| 14 | final hasConnect = find.text('Connect to your object server').evaluate().isNotEmpty; |
| 15 | final hasMainShell = find.text('DBBasic Scroll').evaluate().isNotEmpty; |
| 16 | |
| 17 | expect(hasConnect || hasMainShell, isTrue, |
| 18 | reason: 'Should show connect screen or main shell'); |
| 19 | }); |
| 20 | |
| 21 | testWidgets('If connected, switchboard loads', (tester) async { |
| 22 | app.main(); |
| 23 | await tester.pumpAndSettle(const Duration(seconds: 3)); |
| 24 | |
| 25 | // If we auto-connected, the switchboard should be visible |
| 26 | final hasSwitchboard = find.text('What would you like to do?').evaluate().isNotEmpty; |
| 27 | if (hasSwitchboard) { |
| 28 | // Quick actions should exist |
| 29 | expect(find.text('QUICK ACTIONS'), findsOneWidget); |
| 30 | expect(find.text('VIEWS'), findsOneWidget); |
| 31 | expect(find.text('REPORTS'), findsOneWidget); |
| 32 | |
| 33 | // At least one view tile |
| 34 | expect(find.text('Contacts'), findsOneWidget); |
| 35 | expect(find.text('Projects'), findsOneWidget); |
| 36 | } |
| 37 | }); |
| 38 | } |