feat(flutter): 首页顶栏改为通知铃铛入口
This commit is contained in:
1 parent
e32fa58979
commit
524b7f5b35
2 files changed
+56
-24
No files matched your search
@@ -63,7 +63,7 @@ void main() {
|
||||
|
||||
expect(find.byKey(const Key('home-search')), findsOneWidget);
|
||||
expect(find.byKey(const Key('home-profile')), findsOneWidget);
|
||||
expect(find.byKey(const Key('home-weekday')), findsOneWidget);
|
||||
expect(find.byKey(const Key('home-notifications')), findsOneWidget);
|
||||
for (final channel in ['hot', 'free', 'newReleases', 'ranking']) {
|
||||
expect(find.byKey(Key('home-channel-$channel')), findsOneWidget);
|
||||
}
|
||||
@@ -76,6 +76,35 @@ void main() {
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
testWidgets('should_open_notices_when_bell_is_tapped', (tester) async {
|
||||
SharedPreferencesAsyncPlatform.instance =
|
||||
InMemorySharedPreferencesAsync.empty();
|
||||
tester.view.physicalSize = const Size(390, 844);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.resetPhysicalSize);
|
||||
addTearDown(tester.view.resetDevicePixelRatio);
|
||||
final catalog = FakeCatalogRepository();
|
||||
await tester.pumpWidget(
|
||||
LumaDramaApp(
|
||||
playerFactory: createWidgetPlayer,
|
||||
catalogRepository: catalog,
|
||||
categoryRepository: FakeCategoryRepository(catalog: catalog),
|
||||
watchHistoryRepository: InMemoryWatchHistoryRepository(),
|
||||
favoriteRepository: InMemoryFavoriteRepository(cards: catalog.dramas),
|
||||
playbackRepository: FakePlaybackRepository(),
|
||||
commentRepository: FakeCommentRepository(),
|
||||
interactionRepository: FakeInteractionRepository(),
|
||||
noticeRepository: FakeNoticeRepository(),
|
||||
haptics: FakeHaptics(),
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
await tester.tap(find.byKey(const Key('home-notifications')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byKey(const Key('notices-page')), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('should_use_episode_title_then_drama_title_as_fallback', (
|
||||
tester,
|
||||
) async {
|
||||
|
||||
Reference in new issue
Block a user