Files
apidash/test/widgets/intro_message_test.dart
Yousef Rabia e14446f2e3 Replace tester.pumpAndSettle(); with tester.pump();
Replacing `tester.pumpAndSettle();` with `tester.pump();` resolves an issue where `pumpAndSettle()` waits for all animations to complete, causing an infinite loop with `CircularProgressIndicator`. Using `pump()` ensures efficient frame building without unnecessary animation waiting.
2024-03-01 17:18:42 +02:00

30 lines
861 B
Dart

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:apidash/widgets/intro_message.dart';
void main() {
testWidgets('Testing Intro Message', (tester) async {
await tester.pumpWidget(
const MaterialApp(
title: 'Intro Message',
home: Scaffold(
body: IntroMessage(),
),
),
);
await tester.pump();
expect(find.text('Welcome to API Dash ⚡️'), findsOneWidget);
expect(find.byType(RichText), findsAtLeastNWidgets(1));
expect(
find.textContaining("Please support this project by giving us a ",
findRichText: true),
findsOneWidget);
expect(find.byIcon(Icons.star), findsOneWidget);
expect(find.text('Star on GitHub'), findsOneWidget);
await tester.tap(find.byIcon(Icons.star));
}, skip: true);
}