This commit is contained in:
1 parent
b61bfe625c
commit
938435dfb9
4 files changed
+21
-8
No files matched your search
@@ -268,6 +268,7 @@ void main() {
|
||||
);
|
||||
final decoration = decorated.decoration as BoxDecoration;
|
||||
expect(decoration.color, AppColors.watchAllSurface);
|
||||
expect(decoration.border?.top.color, AppColors.watchAllBorder);
|
||||
expect(decoration.gradient, isNull);
|
||||
expect(tester.widget<Text>(find.text('Watch all')).style?.fontSize, 16);
|
||||
expect(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Author: fruit.com.cn
|
||||
// 职责:检查观看全集按钮实际绘制像素,防止配色只配置而不可见。
|
||||
// 职责:检查观看全集按钮的玻璃表面确实被绘制出来。
|
||||
import 'dart:typed_data';
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
@@ -29,12 +29,16 @@ Future<void> _pumpButton(WidgetTester tester) => tester.pumpWidget(
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
home: Scaffold(
|
||||
backgroundColor: Colors.black,
|
||||
body: Center(
|
||||
child: RepaintBoundary(
|
||||
key: _boundaryKey,
|
||||
child: SizedBox(
|
||||
width: _width,
|
||||
child: HomeFeedWatchAllBar(drama: _drama, onTap: () {}),
|
||||
child: ColoredBox(
|
||||
color: Colors.black,
|
||||
child: HomeFeedWatchAllBar(drama: _drama, onTap: () {}),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -73,15 +77,15 @@ void main() {
|
||||
expect(sample.a, 1);
|
||||
expect(
|
||||
sample.r,
|
||||
closeTo(AppColors.watchAllSurface.r, _surfaceTolerance),
|
||||
closeTo(AppColors.watchAllSurface.a, _surfaceTolerance),
|
||||
);
|
||||
expect(
|
||||
sample.g,
|
||||
closeTo(AppColors.watchAllSurface.g, _surfaceTolerance),
|
||||
closeTo(AppColors.watchAllSurface.a, _surfaceTolerance),
|
||||
);
|
||||
expect(
|
||||
sample.b,
|
||||
closeTo(AppColors.watchAllSurface.b, _surfaceTolerance),
|
||||
closeTo(AppColors.watchAllSurface.a, _surfaceTolerance),
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user