From 57d3b22c1be2275ac8bd697e129ae7befa8b528c Mon Sep 17 00:00:00 2001 From: Crondung <1922635@stud.hs-mannheim.de> Date: Mon, 6 Mar 2023 21:00:05 +0100 Subject: [PATCH] completed history list test --- test/widget_tests/history_list_test.dart | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/test/widget_tests/history_list_test.dart b/test/widget_tests/history_list_test.dart index 3ed6809..7354473 100644 --- a/test/widget_tests/history_list_test.dart +++ b/test/widget_tests/history_list_test.dart @@ -65,6 +65,34 @@ void main() { expect(emailIconFinder, findsNothing); expect(correctIconFinder, findsNWidgets(history.length)); }); + + testWidgets( + 'EntryDetails should display ExpansionTiles if entryComment is given', + (widgetTester) async { + String entryCommentSelector(String p0) => ""; + await widgetTester.pumpWidget(WrappedHistoryList( + history: history, + dateSelector: dateSelector, + entryDataSelector: entryDataSelector, + entryCommentSelector: entryCommentSelector, + )); + final expansionTileFinder = find.byType(ExpansionTile); + expect(expansionTileFinder, findsNWidgets(history.length)); + }); + + testWidgets( + 'EntryDetails should display ExpansionTiles if entryComment is not given', + (widgetTester) async { + String entryCommentSelector(String p0) => ""; + await widgetTester.pumpWidget(WrappedHistoryList( + history: history, + dateSelector: dateSelector, + entryDataSelector: entryDataSelector, + entryCommentSelector: entryCommentSelector, + )); + final listTileFinder = find.byType(ListTile); + expect(listTileFinder, findsNWidgets(history.length)); + }); }); }