test EntryDetailTitle

main
Julian Gegner 2023-03-06 19:30:37 +01:00
parent bf749fdeb5
commit bb833f4bfe
1 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,24 @@
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);
});
});
}