Files
platforms/apps/user_app/test/ui/withdrawal_page_test.dart
czl231 3ef33b531d 已完成用户APP首期功能开发
交付用户端首期页面、配套接口、后台资源及测试文档。用户APP构建、静态分析和三个管理后台构建通过;完整测试仍有2项失败,后端模型注释检查未通过,详见交付记录。
2026-09-13 00:57:32 +08:00

41 lines
1.5 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 功能描述提现页面真实校验、二次确认和状态语义测试版本1.0.0。
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:user_app/ui/core/app_theme.dart';
import 'package:user_app/ui/features/wallet/withdrawal_page.dart';
import '../support/a1_fixture.dart';
void main() {
testWidgets('提现展示真实可提余额并在二次确认后提交', (tester) async {
final repo = A1FixtureRepository();
await tester.pumpWidget(
MaterialApp(
theme: AppTheme.light(),
home: WithdrawalPage(repository: repo),
),
);
await tester.pumpAndSettle();
expect(find.text('¥568.00'), findsOneWidget);
await tester.enterText(find.byKey(const Key('withdrawal-amount')), '50');
await tester.scrollUntilVisible(
find.text('支付密码验证'),
260,
scrollable: find.byType(Scrollable).first,
);
await tester.enterText(find.byKey(const Key('withdrawal-password')), '123456');
await tester.scrollUntilVisible(
find.text('提交提现申请'),
260,
scrollable: find.byType(Scrollable).first,
);
await tester.tap(find.text('提交提现申请'));
await tester.pumpAndSettle();
expect(find.text('确认提现申请'), findsOneWidget);
await tester.tap(find.text('确认提交'));
await tester.pumpAndSettle();
expect(repo.withdrawalCalls, 1);
expect(find.textContaining('提现申请已提交'), findsOneWidget);
});
}