feat(recommend): 轮播只保留标题简介并重做顶部导航
This commit is contained in:
1 parent
53e8c924a6
commit
9ef8eb15b0
6 files changed
+180
-205
No files matched your search
@@ -0,0 +1,48 @@
|
||||
// Author: fruit.com.cn
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:fruitshorts/core/theme/app_dimens.dart';
|
||||
import 'package:fruitshorts/l10n/app_localizations.dart';
|
||||
import 'package:fruitshorts/pages/recommend/recommend_types.dart';
|
||||
import 'package:fruitshorts/pages/recommend/widgets/recommend_top_nav.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('should_keep_large_text_and_actions_inside_narrow_top_nav', (
|
||||
tester,
|
||||
) async {
|
||||
tester.view.physicalSize = const Size(320, 640);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.resetPhysicalSize);
|
||||
addTearDown(tester.view.resetDevicePixelRatio);
|
||||
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
locale: const Locale('id'),
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
home: MediaQuery(
|
||||
data: const MediaQueryData(textScaler: TextScaler.linear(2)),
|
||||
child: Scaffold(
|
||||
body: RecommendTopNav(
|
||||
selected: RecommendInnerTab.feed,
|
||||
onSelected: (_) {},
|
||||
onSearch: () {},
|
||||
onGift: () {},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
expect(tester.takeException(), isNull);
|
||||
expect(
|
||||
tester.getSize(find.byKey(const Key('recommend-search'))),
|
||||
const Size.square(AppDimens.tapTarget),
|
||||
);
|
||||
expect(
|
||||
tester.getSize(find.byKey(const Key('recommend-gift'))),
|
||||
const Size.square(AppDimens.tapTarget),
|
||||
);
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user