Skip to content

Commit

Permalink
✨[feat]: 로그인 관련 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Roy-wonji committed Sep 27, 2024
1 parent 1b8e655 commit 85ba076
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 98 deletions.
2 changes: 1 addition & 1 deletion .mise.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[tools]
tuist = "4.20.0"
tuist = "4.27.0"
2 changes: 1 addition & 1 deletion OPeace/.mise.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[tools]
tuist = "4.25.0"
tuist = "4.27.0"
58 changes: 35 additions & 23 deletions OPeace/Projects/App/OPeace.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
version = "1.3">
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
Expand Down Expand Up @@ -44,12 +44,10 @@
disableMainThreadChecker = "YES">
<TestPlans>
<TestPlanReference
default = "YES"
reference = "container:OPeaceTests/Sources/OPeaceTestPlan.xctestplan">
reference = "container:OPeaceTests/Sources/OPeaceTestPlan.xctestplan"
default = "YES">
</TestPlanReference>
</TestPlans>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand Down
130 changes: 65 additions & 65 deletions OPeace/Projects/App/OpeaceTests/Sources/ProfileTest.swift
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
//////
////// ProfileTest.swift
////// OPeaceTests
//////
////// Created by 서원지 on 8/13/24.
//////
//
//import Testing
//import Presentation
//import ComposableArchitecture
//@testable import OPeace
// ProfileTest.swift
// OPeaceTests
//
//import XCTest
//import UseCase
//import Model
//import Utills
// Created by 서원지 on 8/13/24.
//
//
//@MainActor
//struct ProfileTest {
// let store = TestStore(initialState: Profile.State()) {
// Profile()
// } withDependencies: {
// let repository = AuthRepository()
// $0.authUseCase = AuthUseCase(repository: repository)
// }
//
// @Test("유저 정보 조회")
// func testUserInfo_유저정보_조회() async throws {
// var mockUpdateUserInfo = UpdateUserInfoModel.mockModel
//
// await store.send(.async(.fetchUserProfileResponse(.success(mockUpdateUserInfo)))) { state in
// state.profileUserModel = mockUpdateUserInfo
// }
//
// await store.send(.async(.fetchUser))
//
// store.assert { state in
// state.profileUserModel = mockUpdateUserInfo
// }
//
// let mockError = CustomError.unknownError("Failed to fetch user info")
//
//
// await store.send(.async(.fetchUserProfileResponse(.failure(mockError)))) {
// XCTAssertNil($0.profileUserModel)
// }
//
//
//
// await store.finish()
// store.exhaustivity = .off
// }
//
// @Test("유저 정보 업데이트")
// func testUserInfo_유저정보_업데이트() async throws {
// let testEditStore = TestStore(initialState: EditProfile.State()) {
// EditProfile()
// } withDependencies: {
// let repository = AuthRepository()
// $0.authUseCase = AuthUseCase(repository: repository)
// let signupRepository = SingUpRepository()
// $0.signUpUseCase = SignUpUseCase(repository: signupRepository)
// }
//
// await testEditStore.send(.async(.updateUserInfo(nickName: "로이", year: 1998, job: "개발", generation: "Z 세대")))
// }
//}

import Testing
import Presentation
import ComposableArchitecture
@testable import OPeace

import XCTest
import UseCase
import Model
import Utills


@MainActor
struct ProfileTest {
let store = TestStore(initialState: Profile.State()) {
Profile()
} withDependencies: {
let repository = AuthRepository()
$0.authUseCase = AuthUseCase(repository: repository)
}

@Test("유저 정보 조회")
func testUserInfo_유저정보_조회() async throws {
var mockUpdateUserInfo = UpdateUserInfoModel.mockModel

await store.send(.async(.fetchUserProfileResponse(.success(mockUpdateUserInfo)))) { state in
state.profileUserModel = mockUpdateUserInfo
}

await store.send(.async(.fetchUser))

store.assert { state in
state.profileUserModel = mockUpdateUserInfo
}

let mockError = CustomError.unknownError("Failed to fetch user info")


await store.send(.async(.fetchUserProfileResponse(.failure(mockError)))) {
XCTAssertNil($0.profileUserModel)
}



await store.finish()
store.exhaustivity = .off
}

@Test("유저 정보 업데이트")
func testUserInfo_유저정보_업데이트() async throws {
let testEditStore = TestStore(initialState: EditProfile.State()) {
EditProfile()
} withDependencies: {
let repository = AuthRepository()
$0.authUseCase = AuthUseCase(repository: repository)
let signupRepository = SingUpRepository()
$0.signUpUseCase = SignUpUseCase(repository: signupRepository)
}

await testEditStore.send(.async(.updateUserInfo(nickName: "로이", year: 1998, job: "개발", generation: "Z 세대")))
}
}
4 changes: 2 additions & 2 deletions OPeace/Tuist/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@
"kind" : "remoteSourceControl",
"location" : "http://github.com/pointfreeco/swift-composable-architecture",
"state" : {
"revision" : "0d8980f5bcc5fe6941f1788758667ff2b8c10f03",
"version" : "1.14.0"
"revision" : "8013f1a72af8ccb2b1735d7aed831a8dc07c6fd0",
"version" : "1.15.0"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion OPeace/Tuist/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import ProjectDescription
let package = Package(
name: "OPeace",
dependencies: [
.package(url: "http://github.com/pointfreeco/swift-composable-architecture", exact: "1.14.0"),
.package(url: "http://github.com/pointfreeco/swift-composable-architecture", from: "1.15.0"),
.package(url: "https://github.com/Moya/Moya.git", from: "15.0.3"),
.package(url: "https://github.com/pointfreeco/swift-concurrency-extras.git", from: "1.1.0"),
.package(url: "https://github.com/apple/swift-collections.git", branch: "main"),
Expand Down

0 comments on commit 85ba076

Please sign in to comment.