42 lines
1.1 KiB
Dart
42 lines
1.1 KiB
Dart
|
import 'package:flutter/material.dart';
|
||
|
import 'package:flutter_test/flutter_test.dart';
|
||
|
import 'package:intl/date_symbol_data_local.dart';
|
||
|
import 'package:smoke_cess_app/widgets/entry_detail_widget.dart';
|
||
|
|
||
|
void main() {
|
||
|
initializeDateFormatting('de');
|
||
|
testWidgets('Entry Detail should use ExpansionTile if Comments is set',
|
||
|
(WidgetTester tester) async {
|
||
|
await tester.pumpWidget(
|
||
|
MaterialApp(
|
||
|
home: Scaffold(
|
||
|
body: EntryDetail(
|
||
|
date: DateTime.now(),
|
||
|
entryComment: 'A comment',
|
||
|
entryData: 'Test',
|
||
|
iconData: Icons.plus_one,
|
||
|
),
|
||
|
)),
|
||
|
);
|
||
|
|
||
|
expect(find.byType(ExpansionTile), findsOneWidget);
|
||
|
});
|
||
|
|
||
|
testWidgets('Entry Detail should use ListTile if Comments is null',
|
||
|
(WidgetTester tester) async {
|
||
|
await tester.pumpWidget(
|
||
|
MaterialApp(
|
||
|
home: Scaffold(
|
||
|
body: EntryDetail(
|
||
|
date: DateTime.now(),
|
||
|
entryComment: 'A comment',
|
||
|
entryData: 'Test',
|
||
|
iconData: Icons.plus_one,
|
||
|
),
|
||
|
)),
|
||
|
);
|
||
|
|
||
|
expect(find.byType(ListTile), findsOneWidget);
|
||
|
});
|
||
|
}
|