mirror of
https://github.com/Dvorinka/1356.git
synced 2026-06-03 19:42:57 +00:00
54 lines
1.4 KiB
Dart
54 lines
1.4 KiB
Dart
// ignore_for_file: unnecessary_const
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:lifetimer/features/profile/presentation/profile_screen.dart';
|
|
|
|
void main() {
|
|
group('ProfileScreen Widget', () {
|
|
testWidgets('should display profile title', (WidgetTester tester) async {
|
|
await tester.pumpWidget(
|
|
const ProviderScope(
|
|
child: const MaterialApp(
|
|
home: ProfileScreen(),
|
|
),
|
|
),
|
|
);
|
|
|
|
await tester.pumpAndSettle();
|
|
|
|
expect(find.text('Profile'), findsOneWidget);
|
|
});
|
|
|
|
testWidgets('should display signed out state', (WidgetTester tester) async {
|
|
await tester.pumpWidget(
|
|
const ProviderScope(
|
|
child: const MaterialApp(
|
|
home: ProfileScreen(),
|
|
),
|
|
),
|
|
);
|
|
|
|
await tester.pumpAndSettle();
|
|
|
|
expect(find.text('Not Signed In'), findsOneWidget);
|
|
expect(find.text('Please sign in to view your profile'), findsOneWidget);
|
|
});
|
|
|
|
testWidgets('should display signed out icon', (WidgetTester tester) async {
|
|
await tester.pumpWidget(
|
|
const ProviderScope(
|
|
child: const MaterialApp(
|
|
home: ProfileScreen(),
|
|
),
|
|
),
|
|
);
|
|
|
|
await tester.pumpAndSettle();
|
|
|
|
expect(find.byIcon(Icons.person_off), findsOneWidget);
|
|
});
|
|
});
|
|
}
|