refactor: UI 화면 통합 및 불필요한 파일 정리
- 모든 *_redesign.dart 파일을 기본 화면 파일로 통합 - 백업용 컨트롤러 파일들 제거 (*_controller.backup.dart) - 사용하지 않는 예제 및 테스트 파일 제거 - Clean Architecture 적용 후 남은 정리 작업 완료 - 테스트 코드 정리 및 구조 개선 준비 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,7 @@ import 'package:superport/services/auth_service.dart';
|
||||
import 'package:superport/data/models/auth/login_request.dart';
|
||||
import 'package:superport/data/models/auth/login_response.dart';
|
||||
import 'package:superport/data/models/auth/auth_user.dart';
|
||||
import 'package:superport/core/utils/error_handler.dart';
|
||||
import 'package:superport/core/errors/failures.dart' as failures;
|
||||
|
||||
import 'login_usecase_test.mocks.dart';
|
||||
|
||||
@@ -51,7 +51,7 @@ void main() {
|
||||
test('로그인 성공 시 Right(LoginResponse) 반환', () async {
|
||||
// arrange
|
||||
when(mockAuthService.login(any))
|
||||
.thenAnswer((_) async => tLoginResponse);
|
||||
.thenAnswer((_) async => Right(tLoginResponse));
|
||||
|
||||
// act
|
||||
final result = await loginUseCase(
|
||||
@@ -77,7 +77,7 @@ void main() {
|
||||
expect(result.isLeft(), true);
|
||||
result.fold(
|
||||
(failure) {
|
||||
expect(failure, isA<AppFailure>());
|
||||
expect(failure, isA<failures.Failure>());
|
||||
expect(failure.message, '올바른 이메일 형식이 아닙니다.');
|
||||
},
|
||||
(_) => fail('Should return failure'),
|
||||
@@ -95,7 +95,7 @@ void main() {
|
||||
expect(result.isLeft(), true);
|
||||
result.fold(
|
||||
(failure) {
|
||||
expect(failure, isA<AppFailure>());
|
||||
expect(failure, isA<failures.Failure>());
|
||||
expect(failure.message, '비밀번호를 입력해주세요.');
|
||||
},
|
||||
(_) => fail('Should return failure'),
|
||||
@@ -125,7 +125,7 @@ void main() {
|
||||
expect(result.isLeft(), true);
|
||||
result.fold(
|
||||
(failure) {
|
||||
expect(failure, isA<AppFailure>());
|
||||
expect(failure, isA<failures.Failure>());
|
||||
expect(failure.message, contains('인증'));
|
||||
},
|
||||
(_) => fail('Should return failure'),
|
||||
@@ -150,7 +150,7 @@ void main() {
|
||||
expect(result.isLeft(), true);
|
||||
result.fold(
|
||||
(failure) {
|
||||
expect(failure, isA<AppFailure>());
|
||||
expect(failure, isA<failures.Failure>());
|
||||
expect(failure.message, contains('네트워크'));
|
||||
},
|
||||
(_) => fail('Should return failure'),
|
||||
@@ -180,7 +180,7 @@ void main() {
|
||||
expect(result.isLeft(), true);
|
||||
result.fold(
|
||||
(failure) {
|
||||
expect(failure, isA<AppFailure>());
|
||||
expect(failure, isA<failures.Failure>());
|
||||
expect(failure.message, contains('서버'));
|
||||
},
|
||||
(_) => fail('Should return failure'),
|
||||
@@ -201,7 +201,7 @@ void main() {
|
||||
expect(result.isLeft(), true);
|
||||
result.fold(
|
||||
(failure) {
|
||||
expect(failure, isA<AppFailure>());
|
||||
expect(failure, isA<failures.Failure>());
|
||||
expect(failure.message, contains('오류'));
|
||||
},
|
||||
(_) => fail('Should return failure'),
|
||||
@@ -210,7 +210,7 @@ void main() {
|
||||
|
||||
test('로그인 실패 시 (null 반환) AuthFailure 반환', () async {
|
||||
// arrange
|
||||
when(mockAuthService.login(any)).thenAnswer((_) async => null);
|
||||
when(mockAuthService.login(any)).thenAnswer((_) async => Left(failures.AuthenticationFailure(message: '로그인에 실패했습니다.')));
|
||||
|
||||
// act
|
||||
final result = await loginUseCase(
|
||||
@@ -221,7 +221,7 @@ void main() {
|
||||
expect(result.isLeft(), true);
|
||||
result.fold(
|
||||
(failure) {
|
||||
expect(failure, isA<AppFailure>());
|
||||
expect(failure, isA<failures.Failure>());
|
||||
expect(failure.message, contains('로그인'));
|
||||
},
|
||||
(_) => fail('Should return failure'),
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:superport/data/models/license/license_dto.dart';
|
||||
import 'package:superport/data/repositories/license_repository.dart';
|
||||
import 'package:superport/domain/usecases/base_usecase.dart';
|
||||
import 'package:superport/domain/usecases/license/create_license_usecase.dart';
|
||||
import 'package:superport/core/errors/failures.dart';
|
||||
|
||||
import 'create_license_usecase_test.mocks.dart';
|
||||
|
||||
@@ -32,14 +33,19 @@ void main() {
|
||||
|
||||
final mockLicense = LicenseDto(
|
||||
id: 1,
|
||||
equipmentId: 1,
|
||||
companyId: 1,
|
||||
licenseKey: 'TEST-LICENSE-KEY',
|
||||
productName: 'Test Product',
|
||||
vendor: 'Test Vendor',
|
||||
licenseType: 'maintenance',
|
||||
startDate: DateTime(2025, 1, 1),
|
||||
userCount: 10,
|
||||
purchaseDate: DateTime(2025, 1, 1),
|
||||
expiryDate: DateTime(2025, 12, 31),
|
||||
description: 'Test license',
|
||||
cost: 1000.0,
|
||||
status: 'active',
|
||||
purchasePrice: 1000.0,
|
||||
companyId: 1,
|
||||
branchId: 1,
|
||||
assignedUserId: 1,
|
||||
remark: 'Test license',
|
||||
isActive: true,
|
||||
createdAt: DateTime.now(),
|
||||
updatedAt: DateTime.now(),
|
||||
);
|
||||
|
||||
@@ -2,10 +2,12 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:mockito/annotations.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:superport/data/models/warehouse_location/warehouse_location.dart';
|
||||
import 'package:superport/data/models/warehouse/warehouse_dto.dart';
|
||||
import 'package:superport/data/repositories/warehouse_location_repository.dart';
|
||||
import 'package:superport/domain/usecases/base_usecase.dart';
|
||||
import 'package:superport/domain/usecases/warehouse_location/create_warehouse_location_usecase.dart';
|
||||
import 'package:superport/core/errors/failures.dart';
|
||||
import 'package:superport/models/address_model.dart';
|
||||
|
||||
import 'create_warehouse_location_usecase_test.mocks.dart';
|
||||
|
||||
@@ -30,18 +32,14 @@ void main() {
|
||||
longitude: 126.9780,
|
||||
);
|
||||
|
||||
final mockLocation = WarehouseLocation(
|
||||
final mockLocation = WarehouseLocationDto(
|
||||
id: 1,
|
||||
name: 'Main Warehouse',
|
||||
address: '123 Storage Street',
|
||||
description: 'Primary storage location',
|
||||
contactNumber: '010-1234-5678',
|
||||
manager: 'John Doe',
|
||||
latitude: 37.5665,
|
||||
longitude: 126.9780,
|
||||
managerName: 'John Doe',
|
||||
managerPhone: '010-1234-5678',
|
||||
isActive: true,
|
||||
createdAt: DateTime.now(),
|
||||
updatedAt: DateTime.now(),
|
||||
);
|
||||
|
||||
test('창고 위치 생성 성공', () async {
|
||||
|
||||
Reference in New Issue
Block a user