Skip to content

Commit

Permalink
[WEAV-140] Job Selection 테스트 코드 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
jisu15-kim committed Nov 24, 2024
1 parent fb2bc2d commit 597e768
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ extension EditProfileJobIntent: EditProfileJobIntent.Intentable {
newUserInfo.profile.jobOccupationRawValue = state.singleSelectedJob!.rawValue
model?.setLoading(status: true)
try await requestEditProfile(newUserInfo: newUserInfo)
model?.setLoading(status: false)
await popToRoot()
} catch {
ToastHelper.showErrorMessage(error.localizedDescription)
Expand Down
22 changes: 19 additions & 3 deletions Projects/Features/Home/UnitTest/EditProfileJobOccupationTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,27 @@
//

import Testing
@testable import Home
import NetworkKit

struct EditProfileJobOccupationTests {

@Test func something() async throws {
// Write your test here and use APIs like `#expect(...)` to check expected conditions.

let state: EditProfileJobModel
let intent: EditProfileJobIntent

init() {
state = EditProfileJobModel()
intent = EditProfileJobIntent(
model: state,
input: .init(userInfo: .mock),
service: ProfileServiceMock()
)
}

@Test func jobSelection() async throws {
intent.onTapJobOccupation(
selectedJob: .business
)
#expect(state.singleSelectedJob == .business)
}
}

0 comments on commit 597e768

Please sign in to comment.