전역 구조 리팩터링 및 테스트 확장

This commit is contained in:
JiWoong Sul
2025-09-29 01:51:47 +09:00
parent c00c0c9ab2
commit fef7108479
70 changed files with 7709 additions and 3185 deletions

View File

@@ -138,6 +138,48 @@ void main() {
expect(find.text('고객사명을 입력하세요.'), findsOneWidget);
});
testWidgets('우편번호를 수동 입력하면 검색 안내를 노출한다', (tester) async {
when(
() => repository.list(
page: any(named: 'page'),
pageSize: any(named: 'pageSize'),
query: any(named: 'query'),
isPartner: any(named: 'isPartner'),
isGeneral: any(named: 'isGeneral'),
isActive: any(named: 'isActive'),
),
).thenAnswer(
(_) async => PaginatedResult<Customer>(
items: const [],
page: 1,
pageSize: 20,
total: 0,
),
);
await tester.pumpWidget(
_buildApp(CustomerPage(routeUri: Uri(path: '/masters/customers'))),
);
await tester.pumpAndSettle();
await tester.tap(find.text('신규 등록'));
await tester.pumpAndSettle();
final fields = find.descendant(
of: find.byType(Dialog),
matching: find.byType(EditableText),
);
await tester.enterText(fields.at(0), 'C-200');
await tester.enterText(fields.at(1), '검색 필요 고객');
await tester.enterText(fields.at(4), '06000');
await tester.tap(find.text('등록'));
await tester.pump();
expect(find.text('우편번호 검색으로 주소를 선택하세요.'), findsOneWidget);
});
testWidgets('신규 등록 성공 시 repository.create 호출', (tester) async {
var listCallCount = 0;
when(