결재 비활성 안내 개선 및 테이블 기능 보강
This commit is contained in:
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user