From cffaaf56a9669d2fb4326f6d439a6bc168b1e144 Mon Sep 17 00:00:00 2001 From: Larry Aasen Date: Sun, 10 Dec 2023 14:45:06 -0500 Subject: [PATCH] Added two more unit tests. --- test/upgrader_test.dart | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/test/upgrader_test.dart b/test/upgrader_test.dart index 91729549..3d72efce 100644 --- a/test/upgrader_test.dart +++ b/test/upgrader_test.dart @@ -495,6 +495,36 @@ void main() { expect(called, false); }, skip: false); + testWidgets('test UpgradeAlert no update', (WidgetTester tester) async { + expect(Upgrader.sharedInstance.isTooSoon(), false); + + final upgradeAlert = wrapper(UpgradeAlert()); + await tester.pumpWidget(upgradeAlert); + + // Pump the UI + await tester.pumpAndSettle(); + + expect(find.text('IGNORE'), findsNothing); + expect(find.text('LATER'), findsNothing); + expect(find.text('UPDATE'), findsNothing); + expect(find.text('Release Notes'), findsNothing); + }); + + testWidgets('test UpgradeCard no update', (WidgetTester tester) async { + expect(Upgrader.sharedInstance.isTooSoon(), false); + + final upgradeCard = wrapper(UpgradeCard()); + await tester.pumpWidget(upgradeCard); + + // Pump the UI + await tester.pumpAndSettle(); + + expect(find.text('IGNORE'), findsNothing); + expect(find.text('LATER'), findsNothing); + expect(find.text('UPDATE'), findsNothing); + expect(find.text('Release Notes'), findsNothing); + }); + testWidgets('test UpgradeCard upgrade', (WidgetTester tester) async { final client = MockITunesSearchClient.setupMockClient(); final upgrader = Upgrader(