feat: consolidate backend and docker-compose setup
This commit is contained in:
commit
ff3753a745
306 files changed
+35450
No files matched your search
@@ -0,0 +1,43 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:app_pfm_ocr_v2/features/auth/login_screen.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('LoginScreen validation tests', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const ProviderScope(
|
||||
child: MaterialApp(
|
||||
home: LoginScreen(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
// Find the login button
|
||||
final loginButtonFinder = find.byType(ElevatedButton);
|
||||
expect(loginButtonFinder, findsOneWidget);
|
||||
|
||||
// Tap login button with empty inputs
|
||||
await tester.tap(loginButtonFinder);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
// Verify inline validation error text is displayed
|
||||
expect(find.text('Username/ID cannot be empty'), findsOneWidget);
|
||||
expect(find.text('Password cannot be empty'), findsOneWidget);
|
||||
|
||||
// Enter a username, and a short password (e.g. 5 chars)
|
||||
final textFormFields = find.byType(TextFormField);
|
||||
expect(textFormFields, findsNWidgets(2));
|
||||
|
||||
await tester.enterText(textFormFields.first, 'admin');
|
||||
await tester.enterText(textFormFields.last, '12345');
|
||||
|
||||
// Tap the login button again
|
||||
await tester.tap(loginButtonFinder);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
// Verify username warning is gone, but password length warning appears
|
||||
expect(find.text('Username/ID cannot be empty'), findsNothing);
|
||||
expect(find.text('Password must be at least 6 characters'), findsOneWidget);
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user