feat(nav): 底部导航改为首页推荐追剧我的
This commit is contained in:
1 parent
ec3cb8f163
commit
91e869d589
34 files changed
+359
-263
No files matched your search
@@ -10,6 +10,7 @@ import 'package:fruitshorts/core/data/models/feed_page.dart';
|
||||
import 'package:fruitshorts/core/data/repositories/favorite_repository.dart';
|
||||
import 'package:fruitshorts/core/data/repositories/playback_repository.dart';
|
||||
import 'package:fruitshorts/core/data/repositories/watch_history_repository.dart';
|
||||
import 'package:fruitshorts/core/widgets/app_bottom_nav.dart';
|
||||
import 'package:fruitshorts/pages/home/home_feed_channel.dart';
|
||||
import 'package:fruitshorts/pages/player/player_view.dart';
|
||||
import 'package:shared_preferences_platform_interface/in_memory_shared_preferences_async.dart';
|
||||
@@ -27,7 +28,7 @@ void main() {
|
||||
InMemorySharedPreferencesAsync.empty();
|
||||
});
|
||||
|
||||
testWidgets('should_render_four_tabs_and_open_create_placeholder', (
|
||||
testWidgets('should_render_four_tabs_and_open_following_page', (
|
||||
tester,
|
||||
) async {
|
||||
await _pumpApp(tester);
|
||||
@@ -35,27 +36,14 @@ void main() {
|
||||
for (final key in _tabKeys) {
|
||||
expect(find.byKey(key), findsOneWidget);
|
||||
}
|
||||
expect(find.byKey(const Key('tab-create')), findsNothing);
|
||||
|
||||
await tester.tap(find.byKey(const Key('tab-create')));
|
||||
await tester.tap(find.byKey(const Key('tab-follow')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.byKey(const Key('create-page')), findsOneWidget);
|
||||
expect(find.text('Create'), findsWidgets);
|
||||
expect(find.text('Stories become short dramas'), findsOneWidget);
|
||||
expect(find.byKey(const Key('create-ai')), findsOneWidget);
|
||||
expect(find.byKey(const Key('create-upload')), findsOneWidget);
|
||||
expect(tester.getSize(find.byKey(const Key('create-ai'))).height, 196);
|
||||
expect(find.byKey(const Key('create-motto-primary')), findsOneWidget);
|
||||
expect(find.byKey(const Key('create-motto-secondary')), findsOneWidget);
|
||||
expect(
|
||||
tester.getSize(find.byKey(const Key('create-motto-line'))),
|
||||
const Size(96, 2),
|
||||
);
|
||||
|
||||
await tester.tap(find.byKey(const Key('create-ai')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byKey(const Key('create-placeholder-page')), findsOneWidget);
|
||||
expect(find.text('Coming soon'), findsOneWidget);
|
||||
expect(find.byKey(const Key('favorites-page')), findsOneWidget);
|
||||
expect(find.byKey(const Key('favorites-back')), findsNothing);
|
||||
expect(find.byType(AppBottomNav), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('should_start_home_on_immersive_feed', (tester) async {
|
||||
@@ -334,7 +322,7 @@ void main() {
|
||||
await _pumpApp(tester);
|
||||
expect(_hasLightStatusBar(tester), isTrue);
|
||||
|
||||
await tester.tap(find.byKey(const Key('tab-theater')));
|
||||
await tester.tap(find.byKey(const Key('tab-recommend')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.byKey(const Key('home-page-gradient')), findsOneWidget);
|
||||
@@ -395,7 +383,7 @@ void main() {
|
||||
await _pumpApp(tester);
|
||||
expect(find.byKey(const Key('home-feed-title')), findsOneWidget);
|
||||
|
||||
await tester.tap(find.byKey(const Key('tab-theater')));
|
||||
await tester.tap(find.byKey(const Key('tab-recommend')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.byKey(const Key('home-feed-title')), findsNothing);
|
||||
@@ -418,7 +406,7 @@ void main() {
|
||||
|
||||
testWidgets('should_not_render_theater_language_filters', (tester) async {
|
||||
await _pumpApp(tester);
|
||||
await tester.tap(find.byKey(const Key('tab-theater')));
|
||||
await tester.tap(find.byKey(const Key('tab-recommend')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.byKey(const Key('theater-language-chips')), findsNothing);
|
||||
@@ -435,7 +423,7 @@ void main() {
|
||||
tester,
|
||||
) async {
|
||||
await _pumpApp(tester);
|
||||
await tester.tap(find.byKey(const Key('tab-theater')));
|
||||
await tester.tap(find.byKey(const Key('tab-recommend')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final card = find.byKey(const Key('home-drama-card-the-signal-demo'));
|
||||
@@ -464,7 +452,7 @@ void main() {
|
||||
expect(find.byKey(const Key('home-feed-title')), findsOneWidget);
|
||||
expect(tester.takeException(), isNull);
|
||||
|
||||
await tester.tap(find.byKey(const Key('tab-theater')));
|
||||
await tester.tap(find.byKey(const Key('tab-recommend')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byKey(const Key('theater-category-chips')), findsOneWidget);
|
||||
expect(find.byKey(const Key('theater-language-chips')), findsNothing);
|
||||
@@ -474,8 +462,8 @@ void main() {
|
||||
|
||||
const _tabKeys = [
|
||||
Key('tab-home'),
|
||||
Key('tab-theater'),
|
||||
Key('tab-create'),
|
||||
Key('tab-recommend'),
|
||||
Key('tab-follow'),
|
||||
Key('tab-mine'),
|
||||
];
|
||||
|
||||
|
||||
Reference in new issue
Block a user