Skip to content

Commit

Permalink
add tests for SendConfirmationPage
Browse files Browse the repository at this point in the history
  • Loading branch information
ethan-tbd committed Feb 15, 2024
1 parent 5a95597 commit afa52f0
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions test/features/send/send_confirmation_page_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import 'package:didpay/features/send/send_confirmation_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import '../../helpers/widget_helpers.dart';

void main() {
group('SendConfirmationPage', () {
testWidgets('should show sending payment', (tester) async {
await tester.runAsync(() async {
await tester.pumpWidget(
WidgetHelpers.testableWidget(
child: const SendConfirmationPage(did: '', amount: ''),
),
);

expect(find.text('Sending payment...'), findsOneWidget);
expect(find.byType(CircularProgressIndicator), findsOneWidget);
});
});

testWidgets('should show payment was sent', (tester) async {
await tester.pumpWidget(
WidgetHelpers.testableWidget(
child: const SendConfirmationPage(did: '', amount: ''),
),
);

await tester.pumpAndSettle();

expect(find.text('Your payment was sent!'), findsOneWidget);
expect(find.byIcon(Icons.check_circle), findsOneWidget);
});
});
}

0 comments on commit afa52f0

Please sign in to comment.