feat: 添加视觉设计语言系统并重构认证页面UI
- 新增 visual_design_language.md 设计规范文档 - 新增 auth 设计 tokens (authBackground, authCard, authInput, feedback 系列等) - 重构登录/注册/验证码/重置密码页面为新设计系统 - 新增 AuthHeroHeader, AuthSurfaceCard, AuthSection, AuthField, PasswordField 组件 - 重构 AppBanner 和 Toast 支持多类型配置 (info/success/warning/error) - 后端 AgentScope: 重整 schemas/prompts/tools 作用域, 新增协议文档 - 更新 AGENTS.md 集成视觉设计语言约束
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:mocktail/mocktail.dart';
|
||||
import 'package:social_app/core/notifications/local_notification_service.dart';
|
||||
import 'package:social_app/core/startup/auth_session_bootstrapper.dart';
|
||||
import 'package:social_app/features/auth/presentation/bloc/auth_state.dart';
|
||||
import 'package:social_app/features/calendar/data/services/calendar_service.dart';
|
||||
|
||||
class MockCalendarService extends Mock implements CalendarService {}
|
||||
|
||||
class MockLocalNotificationService extends Mock
|
||||
implements LocalNotificationService {}
|
||||
|
||||
void main() {
|
||||
late MockCalendarService calendarService;
|
||||
late MockLocalNotificationService notificationService;
|
||||
late AuthSessionBootstrapper bootstrapper;
|
||||
|
||||
setUp(() {
|
||||
calendarService = MockCalendarService();
|
||||
notificationService = MockLocalNotificationService();
|
||||
bootstrapper = AuthSessionBootstrapper(
|
||||
calendarService: calendarService,
|
||||
notificationService: notificationService,
|
||||
);
|
||||
});
|
||||
|
||||
test('does not fetch calendar events for unauthenticated state', () async {
|
||||
await bootstrapper.syncForAuthState(AuthUnauthenticated());
|
||||
|
||||
verifyNever(() => calendarService.getEventsForRange(any(), any()));
|
||||
verifyNever(() => notificationService.rebuildUpcomingReminders(any()));
|
||||
});
|
||||
|
||||
test('fetches upcoming events after authenticated state', () async {
|
||||
when(
|
||||
() => calendarService.getEventsForRange(any(), any()),
|
||||
).thenAnswer((_) async => []);
|
||||
when(
|
||||
() => notificationService.rebuildUpcomingReminders(any()),
|
||||
).thenAnswer((_) async {});
|
||||
|
||||
await bootstrapper.syncForAuthState(
|
||||
const AuthAuthenticated(
|
||||
user: AuthUser(id: 'u1', email: 'a@test.com'),
|
||||
),
|
||||
);
|
||||
|
||||
verify(() => calendarService.getEventsForRange(any(), any())).called(1);
|
||||
verify(() => notificationService.rebuildUpcomingReminders(any())).called(1);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user