1
0
forked from baron/baron-sso

접근 제한 UX 구현

This commit is contained in:
2026-04-24 16:32:20 +09:00
parent 0c80063311
commit 5acf248285
7 changed files with 409 additions and 43 deletions

View File

@@ -9,6 +9,7 @@ Future<void> _pumpErrorScreen(
String? errorCode,
String? description,
bool? isProdOverride,
Future<Map<String, dynamic>> Function()? sessionProfileLoader,
}) async {
await tester.pumpWidget(
MaterialApp(
@@ -16,6 +17,7 @@ Future<void> _pumpErrorScreen(
errorCode: errorCode,
description: description,
isProdOverride: isProdOverride,
sessionProfileLoader: sessionProfileLoader,
),
),
);
@@ -193,4 +195,50 @@ void main() {
expect(find.text(type), findsOneWidget);
expect(find.text('원문 메시지'), findsNothing);
});
testWidgets('tenant_not_allowed는 전용 차단 정보를 노출한다', (
WidgetTester tester,
) async {
await _pumpErrorScreen(
tester,
errorCode: 'tenant_not_allowed',
description: '원문 메시지',
isProdOverride: true,
sessionProfileLoader: () async {
return {
'email': 'employee@example.com',
'tenant': {'name': 'Baron HQ', 'slug': 'baron-hq'},
};
},
);
final title = tr(
'msg.userfront.error.title',
fallback: '인증 과정에서 오류가 발생했습니다',
);
final detail = tr(
'msg.userfront.error.tenant.detail',
fallback: '현재 로그인된 계정은 이 애플리케이션에 접근할 수 없습니다.',
);
final account = tr(
'msg.userfront.error.tenant.account',
fallback: '계정',
);
final tenant = tr(
'msg.userfront.error.tenant.tenant',
fallback: '소속 테넌트',
);
final switchAccount = tr(
'ui.userfront.error.switch_account',
fallback: '다른 계정으로 로그인',
);
expect(find.text(title), findsOneWidget);
expect(find.text(detail), findsOneWidget);
expect(find.text(account), findsOneWidget);
expect(find.text('employee@example.com'), findsOneWidget);
expect(find.text(tenant), findsOneWidget);
expect(find.text('Baron HQ'), findsOneWidget);
expect(find.text(switchAccount), findsOneWidget);
});
}