test: 按新 UI 基线重写过期用例

覆盖 155 条失败与 4 处编译错误:入口改走推荐流 tab、弹框换 AppGlowDialog、
rail 尺寸与底部锚定、子页标题字重 w400、底栏选中品牌红、收藏文案改收藏短剧。
全量 flutter test 775 通过。
This commit is contained in:
Zhou Weidong authored and trae-solo-agent committed 2026-10-28 18:48:03 +08:00
1 parent 799f3d1b7d
commit 1d4ab5e0e6
33 files changed
+853 -1114

No files matched your search

+21 -3
View File
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:fruitshorts/core/theme/app_colors.dart';
import 'package:fruitshorts/core/widgets/app_glow_panel.dart';
import 'package:fruitshorts/l10n/app_localizations.dart';
import 'package:fruitshorts/pages/player/widgets/player_more_sheet.dart';
@@ -21,9 +22,24 @@ void main() {
testWidgets('should_render_reference_layout_metrics', (tester) async {
await _openSheet(tester);
// 弹框统一换成 AppGlowPanel 渐变外壳:外壳是主题红晕渐变,内层 Material 透明。
final shell = tester.widget<DecoratedBox>(
find
.descendant(
of: find.byType(AppGlowPanel),
matching: find.byType(DecoratedBox),
)
.first,
);
final shellDecoration = shell.decoration as BoxDecoration;
expect((shellDecoration.gradient! as LinearGradient).colors, [
AppColors.followingGlow,
AppColors.followingGlowMid,
const Color(0xFF101012),
]);
expect(
tester.widget<Material>(find.byKey(const Key('player-more-sheet'))).color,
AppColors.ink,
isNull,
);
expect(
tester.getSize(find.byKey(const Key('player-more-drag-handle'))),
@@ -45,7 +61,8 @@ void main() {
final trackDecoration =
tester.widget<Container>(find.byKey(key)).decoration!
as BoxDecoration;
expect(trackDecoration.color, AppColors.raised);
// 渐变外壳上的分段轨道改成 8% 白色叠层,不再用实色 raised。
expect(trackDecoration.color, Colors.white.withValues(alpha: 0.08));
}
for (final key in const [
Key('player-more-speed-0.75'),
@@ -77,7 +94,8 @@ void main() {
.first,
);
final selectedDecoration = selected.decoration! as BoxDecoration;
expect(selectedDecoration.color, AppColors.card);
// 选中态同样改成 16% 白色叠层。
expect(selectedDecoration.color, Colors.white.withValues(alpha: 0.16));
expect(selectedDecoration.boxShadow, isNotEmpty);
final selectedText = tester.widget<Text>(
find.descendant(