diff --git a/test/widget_tests/widget_entry_detail_test.dart b/test/widget_tests/widget_entry_detail_test.dart new file mode 100644 index 0000000..a741ab5 --- /dev/null +++ b/test/widget_tests/widget_entry_detail_test.dart @@ -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); + }); + }); +}