feat(menu-permissions): 메뉴 API 연동으로 사이드바 권한 정비
- .env.development.example과 lib/core/config/environment.dart, lib/core/permissions/permission_manager.dart에서 PERMISSION__ 폴백을 view 전용으로 좁히고 기본 정책을 명시적으로 거부하도록 재정비했다 - lib/core/navigation/*, lib/core/routing/app_router.dart, lib/widgets/app_shell.dart, lib/main.dart에서 메뉴 매니페스트·카탈로그를 도입해 /menus 응답을 캐싱하고 라우터·사이드바·Breadcrumb가 동일 menu_code/route_path를 쓰도록 리팩터링했다 - lib/core/permissions/permission_resources.dart와 그룹 권한/메뉴 마스터 모듈을 menu_code 기반 CRUD 및 Catalog 경로 정합성 검사로 전환하고 PermissionSynchronizer·PermissionBootstrapper를 확장했다 - test/helpers/test_permissions.dart, test/widgets/app_shell_test.dart 등 신규 구조를 반영하는 테스트·골든과 doc/frontend_menu_permission_tasks.md 문서를 보강했다
This commit is contained in:
@@ -4,12 +4,18 @@ import 'package:get_it/get_it.dart';
|
||||
import 'package:shadcn_ui/shadcn_ui.dart';
|
||||
|
||||
import 'package:superport_v2/core/config/environment.dart';
|
||||
import 'package:superport_v2/core/navigation/route_paths.dart';
|
||||
import 'package:superport_v2/core/permissions/permission_manager.dart';
|
||||
import 'package:superport_v2/core/theme/superport_shad_theme.dart';
|
||||
import 'package:superport_v2/features/inventory/outbound/presentation/pages/outbound_page.dart';
|
||||
|
||||
import '../../helpers/inventory_test_stubs.dart';
|
||||
|
||||
Future<void> _tapVisible(WidgetTester tester, Finder finder) async {
|
||||
await tester.ensureVisible(finder);
|
||||
await tester.tap(finder);
|
||||
}
|
||||
|
||||
void main() {
|
||||
TestWidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
@@ -44,7 +50,9 @@ void main() {
|
||||
child: ShadTheme(
|
||||
data: SuperportShadTheme.light(),
|
||||
child: Scaffold(
|
||||
body: OutboundPage(routeUri: Uri.parse('/inventory/outbound')),
|
||||
body: OutboundPage(
|
||||
routeUri: Uri.parse(inventoryIssuesRoutePath),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -53,12 +61,12 @@ void main() {
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
await tester.tap(find.widgetWithText(ShadButton, '출고 등록'));
|
||||
await _tapVisible(tester, find.widgetWithText(ShadButton, '출고 등록'));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.text('저장 시 자동 생성'), findsAtLeastNWidgets(2));
|
||||
|
||||
await tester.tap(find.widgetWithText(ShadButton, '저장'));
|
||||
await _tapVisible(tester, find.widgetWithText(ShadButton, '저장'));
|
||||
await tester.pump();
|
||||
|
||||
expect(find.text('거래번호를 입력하세요.'), findsNothing);
|
||||
@@ -84,7 +92,9 @@ void main() {
|
||||
child: ShadTheme(
|
||||
data: SuperportShadTheme.light(),
|
||||
child: Scaffold(
|
||||
body: OutboundPage(routeUri: Uri.parse('/inventory/outbound')),
|
||||
body: OutboundPage(
|
||||
routeUri: Uri.parse(inventoryIssuesRoutePath),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -93,14 +103,14 @@ void main() {
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
await tester.tap(find.text('TX-20240302-010').first);
|
||||
await _tapVisible(tester, find.text('TX-20240302-010').first);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.text('출고 상세'), findsOneWidget);
|
||||
|
||||
final editButton = find.widgetWithText(ShadButton, '수정').last;
|
||||
await tester.ensureVisible(editButton);
|
||||
await tester.tap(editButton);
|
||||
await _tapVisible(tester, editButton);
|
||||
await tester.pump();
|
||||
await tester.pumpAndSettle(const Duration(milliseconds: 500));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user