Skip to content

Commit

Permalink
Added two more unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
larryaasen committed Dec 10, 2023
1 parent 93a111d commit cffaaf5
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/upgrader_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit cffaaf5

Please sign in to comment.