25 lines
866 B
Dart
25 lines
866 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:intl/intl.dart';
|
|
import 'package:intl/date_symbol_data_local.dart';
|
|
|
|
import 'package:smoke_cess_app/widgets/entry_detail_title.dart';
|
|
|
|
void main() {
|
|
group('EntryDetailTitle', () {
|
|
DateTime date = DateTime.now();
|
|
String entryData = "TestEntryData";
|
|
initializeDateFormatting('de');
|
|
|
|
testWidgets('EntryDetailTitle has formatted date and entrydata',
|
|
(widgetTester) async {
|
|
await widgetTester.pumpWidget(MaterialApp(
|
|
home: EntryDetailTitle(date: date, entryData: entryData)));
|
|
final formattedDateFinder = find.text(DateFormat.MMMd('de').format(date));
|
|
final entryDataFinder = find.text(entryData);
|
|
expect(formattedDateFinder, findsOneWidget);
|
|
expect(entryDataFinder, findsOneWidget);
|
|
});
|
|
});
|
|
}
|