feat(app): 完善播放协议搜索与空状态
This commit is contained in:
1 parent
671e0ce143
commit
ef29fc5f15
85 files changed
+2976
-768
No files matched your search
@@ -28,7 +28,7 @@ import '../support/fake_notice_repository.dart';
|
||||
import '../support/widget_player.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('should_render_visitor_user_vip_and_seven_grid_entries', (
|
||||
testWidgets('should_render_visitor_user_vip_and_eight_grid_entries', (
|
||||
tester,
|
||||
) async {
|
||||
await _pumpApp(tester, signedIn: false);
|
||||
@@ -118,8 +118,9 @@ void main() {
|
||||
Key('mine-help'),
|
||||
Key('mine-language'),
|
||||
Key('mine-settings'),
|
||||
Key('mine-notices'),
|
||||
];
|
||||
expect(entryKeys, hasLength(7));
|
||||
expect(entryKeys, hasLength(8));
|
||||
for (final entryKey in entryKeys) {
|
||||
expect(find.byKey(entryKey), findsOneWidget);
|
||||
}
|
||||
@@ -155,6 +156,11 @@ void main() {
|
||||
Icons.settings_outlined,
|
||||
AppColors.mineIconSettings,
|
||||
),
|
||||
(
|
||||
Key('mine-notices'),
|
||||
Icons.notifications_none_rounded,
|
||||
AppColors.mineIconNotices,
|
||||
),
|
||||
];
|
||||
for (final entry in coloredIcons) {
|
||||
final icon = tester.widget<Icon>(
|
||||
@@ -172,9 +178,9 @@ void main() {
|
||||
expect(
|
||||
find.descendant(
|
||||
of: find.byKey(const Key('mine-menu-cell-7')),
|
||||
matching: find.byType(Icon),
|
||||
matching: find.byIcon(Icons.notifications_none_rounded),
|
||||
),
|
||||
findsNothing,
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(
|
||||
find.descendant(
|
||||
@@ -280,15 +286,12 @@ void main() {
|
||||
];
|
||||
expect(signedInOrder, [...signedInOrder]..sort());
|
||||
|
||||
expect(find.byKey(const Key('mine-notices')), findsOneWidget);
|
||||
await tester.tap(find.byKey(const Key('mine-edit')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byKey(const Key('mine-edit-profile')), findsOneWidget);
|
||||
expect(find.byKey(const Key('mine-edit-works')), findsOneWidget);
|
||||
expect(find.byKey(const Key('mine-edit-creator')), findsOneWidget);
|
||||
expect(find.byKey(const Key('mine-edit-notices')), findsOneWidget);
|
||||
await tester.tap(find.byKey(const Key('mine-edit-works')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byKey(const Key('mine-placeholder-page')), findsOneWidget);
|
||||
expect(find.byKey(const Key('account-profile-page')), findsOneWidget);
|
||||
expect(find.byKey(const Key('mine-edit-works')), findsNothing);
|
||||
expect(find.byKey(const Key('mine-edit-creator')), findsNothing);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
@@ -353,7 +356,7 @@ void main() {
|
||||
expect(find.byType(FloatingActionButton), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('should_expose_seven_menu_destinations_in_order', (tester) async {
|
||||
testWidgets('should_expose_eight_menu_destinations_in_order', (tester) async {
|
||||
tester.view.physicalSize = const Size(390, 900);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.resetPhysicalSize);
|
||||
@@ -384,6 +387,7 @@ void main() {
|
||||
(Key('mine-history'), MineDestination.history),
|
||||
(Key('mine-watch-preferences'), MineDestination.preferences),
|
||||
(Key('mine-help'), MineDestination.help),
|
||||
(Key('mine-notices'), MineDestination.notices),
|
||||
];
|
||||
for (final row in rows) {
|
||||
await tester.tap(find.byKey(row.$1));
|
||||
|
||||
@@ -59,7 +59,8 @@ void main() {
|
||||
final title = tester.widget<Text>(find.byKey(const Key('subpage-title')));
|
||||
expect(title.style?.fontSize, 18);
|
||||
expect(title.style?.fontWeight, FontWeight.w800);
|
||||
expect(find.byKey(const Key('settings-notices')), findsOneWidget);
|
||||
expect(find.byKey(const Key('settings-notices')), findsNothing);
|
||||
expect(find.byKey(const Key('mine-account-card')), findsNothing);
|
||||
expect(find.byKey(const Key('server-endpoint-setting')), findsNothing);
|
||||
expect(find.text('Server address'), findsNothing);
|
||||
expect(find.text('English'), findsNothing);
|
||||
|
||||
Reference in new issue
Block a user