mirror of
https://github.com/foss42/apidash.git
synced 2025-06-02 07:46:10 +08:00

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.
30 lines
861 B
Dart
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);
|
|
}
|