Merge pull request #334 from Yousef-Rabia/elapsed-time-by-request

Elapsed time by request
This commit is contained in:
Ankit Mahato
2024-03-28 22:07:10 +05:30
committed by GitHub
5 changed files with 110 additions and 13 deletions

View File

@@ -10,13 +10,15 @@ import 'package:apidash/models/models.dart';
import '../test_consts.dart';
void main() {
testWidgets('Testing Sending Widget', (tester) async {
testWidgets('Testing Sending Widget Without Timer', (tester) async {
await tester.pumpWidget(
MaterialApp(
title: 'Send',
theme: kThemeDataDark,
home: const Scaffold(
body: SendingWidget(),
body: SendingWidget(
startSendingTime: null,
),
),
),
);
@@ -24,6 +26,26 @@ void main() {
expect(find.byType(Lottie), findsOneWidget);
});
testWidgets('Testing Sending Widget With Timer', (tester) async {
await tester.pumpWidget(
MaterialApp(
title: 'Send',
theme: kThemeDataDark,
home: Scaffold(
body: SendingWidget(
startSendingTime: DateTime.now(),
),
),
),
);
expect(find.text('Time elapsed: 0 ms'), findsOneWidget);
expect(find.byType(Lottie), findsOneWidget);
await tester.pump(const Duration(seconds: 1));
expect(find.text('Time elapsed: 1.00 s'), findsOneWidget);
});
testWidgets('Testing Not Sent Widget', (tester) async {
await tester.pumpWidget(
const MaterialApp(