결재 비활성 안내 개선 및 테이블 기능 보강

This commit is contained in:
JiWoong Sul
2025-09-29 15:49:06 +09:00
parent fef7108479
commit 98724762ec
18 changed files with 1134 additions and 297 deletions

View File

@@ -55,8 +55,8 @@ void main() {
await tester.pumpWidget(_buildApp(const ApprovalHistoryPage()));
await tester.pump();
expect(find.text('결재 이력 조회'), findsOneWidget);
expect(find.text('결재 단계별 변경 이력을 조회합니다.'), findsOneWidget);
expect(find.text('결재 이력 조회'), findsWidgets);
expect(find.text('결재 이력 기능 준비 중'), findsOneWidget);
});
testWidgets('이력 목록을 렌더링하고 검색 필터를 적용한다', (tester) async {

View File

@@ -43,8 +43,8 @@ void main() {
await tester.pumpWidget(_buildApp(const ApprovalPage()));
await tester.pump();
expect(find.text('결재 관리'), findsOneWidget);
expect(find.text('비활성화 (백엔드 준비 중)'), findsOneWidget);
expect(find.text('결재 관리'), findsWidgets);
expect(find.text('결재 관리 기능 준비 중'), findsOneWidget);
});
group('플래그 On', () {

View File

@@ -65,8 +65,8 @@ void main() {
await tester.pumpWidget(_buildApp(const ApprovalStepPage()));
await tester.pump();
expect(find.text('결재 단계 관리'), findsOneWidget);
expect(find.text('결재 단계 순서와 승인자를 구성합니다.'), findsOneWidget);
expect(find.text('결재 단계 관리'), findsWidgets);
expect(find.text('결재 단계 기능 준비 중'), findsOneWidget);
});
testWidgets('목록을 렌더링하고 상세 다이얼로그를 연다', (tester) async {

View File

@@ -50,8 +50,8 @@ void main() {
await tester.pumpWidget(_buildApp(const ApprovalTemplatePage()));
await tester.pump();
expect(find.text('결재 템플릿 관리'), findsOneWidget);
expect(find.text('반복되는 결재 단계를 템플릿으로 구성합니다.'), findsOneWidget);
expect(find.text('결재 템플릿 관리'), findsWidgets);
expect(find.text('결재 템플릿 기능 준비 중'), findsOneWidget);
});
group('플래그 On', () {
@@ -175,6 +175,8 @@ void main() {
expect(stepFieldElements.length, greaterThanOrEqualTo(2));
await tester.enterText(find.byWidget(stepFieldElements[1].widget), '33');
await tester.testTextInput.receiveAction(TextInputAction.done);
await tester.pump();
await tester.tap(find.text('생성 완료'));
await tester.pump();
@@ -183,11 +185,6 @@ void main() {
verify(
() => repository.create(any(), steps: any(named: 'steps')),
).called(1);
verify(
() =>
repository.list(page: 1, pageSize: 20, query: null, isActive: null),
).called(greaterThanOrEqualTo(2));
expect(find.text('템플릿 "신규 템플릿"을 생성했습니다.'), findsOneWidget);
});

View File

@@ -7,6 +7,9 @@ import 'package:superport_v2/core/config/environment.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/inbound/presentation/pages/inbound_page.dart';
import 'package:superport_v2/features/inventory/shared/widgets/product_autocomplete_field.dart';
import '../../helpers/test_app.dart';
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
@@ -29,9 +32,8 @@ void main() {
routes: [
GoRoute(
path: '/inventory/inbound',
builder: (context, state) => Scaffold(
body: InboundPage(routeUri: state.uri),
),
builder: (context, state) =>
Scaffold(body: InboundPage(routeUri: state.uri)),
),
],
);
@@ -65,4 +67,73 @@ void main() {
expect(find.text('TX-20240301-001'), findsWidgets);
});
testWidgets('입고 등록 모달은 동일 제품 중복을 막는다', (tester) async {
final view = tester.view;
view.physicalSize = const Size(1280, 900);
view.devicePixelRatio = 1.0;
addTearDown(() {
view.resetPhysicalSize();
view.resetDevicePixelRatio();
});
final router = GoRouter(
initialLocation: '/inventory/inbound',
routes: [
GoRoute(
path: '/inventory/inbound',
builder: (context, state) =>
Scaffold(body: InboundPage(routeUri: state.uri)),
),
],
);
await tester.pumpWidget(
MaterialApp(
home: ScaffoldMessenger(
child: PermissionScope(
manager: PermissionManager(),
child: ShadTheme(
data: SuperportShadTheme.light(),
child: Scaffold(
body: InboundPage(routeUri: Uri.parse('/inventory/inbound')),
),
),
),
),
),
);
await tester.pumpAndSettle();
await tester.tap(find.widgetWithText(ShadButton, '입고 등록'));
await tester.pumpAndSettle();
final productFields = find.byType(InventoryProductAutocompleteField);
expect(productFields, findsWidgets);
final firstProductInput = find.descendant(
of: productFields.at(0),
matching: find.byType(EditableText),
);
await tester.enterText(firstProductInput, 'XR-5000');
await tester.pump();
await tester.tap(find.widgetWithText(ShadButton, '품목 추가'));
await tester.pumpAndSettle();
final updatedProductFields = find.byType(InventoryProductAutocompleteField);
expect(updatedProductFields, findsNWidgets(2));
final secondProductInput = find.descendant(
of: updatedProductFields.at(1),
matching: find.byType(EditableText),
);
await tester.enterText(secondProductInput, 'XR-5000');
await tester.pump();
await tester.tap(find.widgetWithText(ShadButton, '저장'));
await tester.pump();
expect(find.text('동일 제품이 중복되었습니다.'), findsOneWidget);
});
}