feat(flutter): 重设计创作与我的页面
This commit is contained in:
1 parent
d50c6e6d9f
commit
03c3964353
17 files changed
+807
-234
No files matched your search
@@ -26,6 +26,8 @@ void main() {
|
||||
|
||||
await tester.tap(find.byKey(const Key('tab-mine')));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.ensureVisible(find.byKey(const Key('mine-settings')));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.byKey(const Key('mine-settings')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
@@ -49,6 +51,8 @@ void main() {
|
||||
|
||||
await tester.tap(find.byKey(const Key('tab-mine')));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.ensureVisible(find.byKey(const Key('mine-settings')));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.byKey(const Key('mine-settings')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
|
||||
@@ -40,6 +40,13 @@ void main() {
|
||||
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);
|
||||
|
||||
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);
|
||||
});
|
||||
|
||||
testWidgets('should_switch_home_channel_when_chip_is_tapped', (tester) async {
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:fruitshorts/app.dart';
|
||||
import 'package:fruitshorts/core/data/models/watch_progress.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';
|
||||
@@ -18,7 +17,7 @@ import '../support/fake_notice_repository.dart';
|
||||
import '../support/widget_player.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('should_render_only_continue_and_six_core_entries', (
|
||||
testWidgets('should_render_minimal_profile_shortcuts_wallet_vip_and_menu', (
|
||||
tester,
|
||||
) async {
|
||||
SharedPreferencesAsyncPlatform.instance =
|
||||
@@ -34,16 +33,7 @@ void main() {
|
||||
playerFactory: createWidgetPlayer,
|
||||
catalogRepository: catalog,
|
||||
categoryRepository: FakeCategoryRepository(catalog: catalog),
|
||||
watchHistoryRepository: InMemoryWatchHistoryRepository(
|
||||
seed: const [
|
||||
WatchProgress(
|
||||
dramaId: 'city-lights-demo',
|
||||
episodeId: 'city-lights-demo-1',
|
||||
position: Duration(minutes: 2),
|
||||
duration: Duration(minutes: 5),
|
||||
),
|
||||
],
|
||||
),
|
||||
watchHistoryRepository: InMemoryWatchHistoryRepository(),
|
||||
favoriteRepository: InMemoryFavoriteRepository(cards: catalog.dramas),
|
||||
playbackRepository: FakePlaybackRepository(),
|
||||
commentRepository: FakeCommentRepository(),
|
||||
@@ -57,15 +47,20 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.byKey(const Key('mine-user-row')), findsOneWidget);
|
||||
expect(find.byKey(const Key('mine-continue-watching')), findsOneWidget);
|
||||
expect(find.byKey(const Key('mine-continue-play')), findsOneWidget);
|
||||
expect(find.byKey(const Key('mine-continue-watching')), findsNothing);
|
||||
for (final key in const [
|
||||
Key('mine-watchlist'),
|
||||
Key('mine-history'),
|
||||
Key('mine-downloads'),
|
||||
Key('mine-wallet'),
|
||||
Key('mine-wallet-recharge'),
|
||||
Key('mine-vip'),
|
||||
Key('mine-menu'),
|
||||
Key('mine-works'),
|
||||
Key('mine-creator-center'),
|
||||
Key('mine-notices'),
|
||||
Key('mine-settings'),
|
||||
Key('mine-help'),
|
||||
]) {
|
||||
expect(find.byKey(key), findsOneWidget);
|
||||
}
|
||||
|
||||
@@ -46,6 +46,8 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.byKey(const Key('tab-mine')));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.ensureVisible(find.byKey(const Key('mine-settings')));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.byKey(const Key('mine-settings')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
|
||||
@@ -46,11 +46,9 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.byKey(const Key('tab-mine')));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.byKey(const Key('mine-settings')));
|
||||
await tester.ensureVisible(find.byKey(const Key('mine-notices')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.byKey(const Key('settings-notices')), findsOneWidget);
|
||||
await tester.tap(find.byKey(const Key('settings-notices')));
|
||||
await tester.tap(find.byKey(const Key('mine-notices')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.byKey(const Key('notices-page')), findsOneWidget);
|
||||
|
||||
Reference in new issue
Block a user