diff --git a/lib/features/account/account_page.dart b/lib/features/account/account_page.dart index 4098a95e..1026efa3 100644 --- a/lib/features/account/account_page.dart +++ b/lib/features/account/account_page.dart @@ -212,12 +212,6 @@ class _AccountPageState extends State { child: Text(appText('登录', 'Sign In')), ), ), - const SizedBox(height: 12), - TextButton( - key: const ValueKey('account-save-local-button'), - onPressed: () => _saveProfile(settings), - child: Text(appText('保存本地入口', 'Save Local Entry')), - ), ], ), ), @@ -332,15 +326,6 @@ class _AccountPageState extends State { ), ], ), - const SizedBox(height: 16), - Align( - alignment: Alignment.centerLeft, - child: FilledButton( - key: const ValueKey('account-save-local-button'), - onPressed: () => _saveProfile(settings), - child: Text(appText('保存本地入口', 'Save Local Entry')), - ), - ), ], ), ); @@ -389,8 +374,8 @@ class _AccountPageState extends State { ) : settings.accountLocalMode ? appText( - '本地模式 · 仅保存账号入口与工作区偏好', - 'Local mode · saves account entry and workspace preferences only', + '本地模式 · 仅保存工作区偏好', + 'Local mode · saves workspace preferences only', ) : appText( '登录后会同步远端默认配置,本地保存项可以覆盖远端默认值。', diff --git a/test/features/account_page_auth_suite.dart b/test/features/account_page_auth_suite.dart index 87c692b3..2302cc2e 100644 --- a/test/features/account_page_auth_suite.dart +++ b/test/features/account_page_auth_suite.dart @@ -26,7 +26,7 @@ void main() { expect(find.byIcon(Icons.cloud_outlined), findsOneWidget); expect(find.byKey(const ValueKey('account-password-field')), findsOneWidget); expect(find.widgetWithText(FilledButton, '登录'), findsOneWidget); - expect(find.byKey(const ValueKey('account-save-local-button')), findsOneWidget); + expect(find.text('保存本地入口'), findsNothing); }); testWidgets('AccountPage logs in and shows remote sync status inline', ( diff --git a/test/features/account_page_suite.dart b/test/features/account_page_suite.dart index 20059a1f..422f192d 100644 --- a/test/features/account_page_suite.dart +++ b/test/features/account_page_suite.dart @@ -25,31 +25,4 @@ void main() { expect(controller.settings.accountWorkspace, 'QA Workspace'); }); - - testWidgets('AccountPage saves local entry from current controller values', ( - WidgetTester tester, - ) async { - final controller = await createTestController(tester); - - await pumpPage(tester, child: AccountPage(controller: controller)); - - await tester.enterText( - find.byKey(const ValueKey('account-base-url-field')), - 'https://accounts.mobile.example', - ); - await tester.enterText( - find.byKey(const ValueKey('account-username-field')), - 'mobile@example.com', - ); - await tester.pumpAndSettle(); - - await tester.tap(find.byKey(const ValueKey('account-save-local-button'))); - await tester.pumpAndSettle(); - - expect( - controller.settings.accountBaseUrl, - 'https://accounts.mobile.example', - ); - expect(controller.settings.accountUsername, 'mobile@example.com'); - }); } diff --git a/test/features/mobile/mobile_shell_suite.dart b/test/features/mobile/mobile_shell_suite.dart index d2493b32..a989d89d 100644 --- a/test/features/mobile/mobile_shell_suite.dart +++ b/test/features/mobile/mobile_shell_suite.dart @@ -82,55 +82,6 @@ void main() { await tester.pumpAndSettle(); } - for (final platform in [ - TargetPlatform.iOS, - TargetPlatform.android, - ]) { - testWidgets( - 'MobileShell saves local account entry from the workspace account page on $platform', - (WidgetTester tester) async { - final controller = await createTestController(tester); - - await pumpMobileShell( - tester, - child: MobileShell(controller: controller), - platform: platform, - ); - - await tester.tap(find.text('工作区')); - await tester.pumpAndSettle(); - final accountEntry = find.text('账号').first; - await tester.ensureVisible(accountEntry); - await tester.pumpAndSettle(); - await tester.tap(accountEntry); - await tester.pumpAndSettle(); - - await tester.enterText( - find.byKey(const ValueKey('account-base-url-field')), - 'https://accounts.qa.example', - ); - await tester.enterText( - find.byKey(const ValueKey('account-username-field')), - 'qa@example.com', - ); - await tester.pumpAndSettle(); - - final saveButton = find.widgetWithText(FilledButton, '保存本地入口'); - await tester.ensureVisible(saveButton); - await tester.pumpAndSettle(); - await tester.tap(saveButton); - await tester.pump(const Duration(milliseconds: 300)); - await tester.pumpAndSettle(); - - expect( - controller.settings.accountBaseUrl, - 'https://accounts.qa.example', - ); - expect(controller.settings.accountUsername, 'qa@example.com'); - }, - ); - } - testWidgets('MobileShell workspace launcher routes into module pages', ( WidgetTester tester, ) async {