From bb833f4bfe8d38c2d0a88a4fea5494449667ae04 Mon Sep 17 00:00:00 2001 From: Crondung <1922635@stud.hs-mannheim.de> Date: Mon, 6 Mar 2023 19:30:37 +0100 Subject: [PATCH] test EntryDetailTitle --- .../widget_entry_detail_test.dart | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/widget_tests/widget_entry_detail_test.dart 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); + }); + }); +}