mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-03-25 08:38:45 +00:00
WIP: widget tests, animated text test
This commit is contained in:
parent
efc5582fb2
commit
3c50077ed1
1 changed files with 37 additions and 0 deletions
37
test/widget_tests/animated_text_test.dart
Normal file
37
test/widget_tests/animated_text_test.dart
Normal file
|
@ -0,0 +1,37 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:stackwallet/utilities/theme/light_colors.dart';
|
||||
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
||||
import 'package:stackwallet/widgets/animated_text.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets("Widget displays first word in strings list",
|
||||
(widgetTester) async {
|
||||
const animatedText = AnimatedText(
|
||||
stringsToLoopThrough: [
|
||||
"Calculating",
|
||||
"Calculating.",
|
||||
"Calculating..",
|
||||
"Calculating...",
|
||||
],
|
||||
style: TextStyle(
|
||||
color: null,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 14,
|
||||
));
|
||||
await widgetTester.pumpWidget(
|
||||
MaterialApp(
|
||||
theme: ThemeData(
|
||||
extensions: [
|
||||
StackColors.fromStackColorTheme(LightColors()),
|
||||
],
|
||||
),
|
||||
home: const Material(
|
||||
child: animatedText,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
expect(find.text("Calculating"), findsOneWidget);
|
||||
});
|
||||
}
|
Loading…
Reference in a new issue