@@ -30,23 +30,35 @@ private final class MockConversationRepository: ConversationRepository {
3030 func endConversation( conversationId: Int ) async throws {
3131 fatalError ( " 사용 안 함 " )
3232 }
33+
34+ func deleteConversations( _ ids: [ Int ] ) async throws {
35+ fatalError ( " 사용 안 함 " )
36+ }
37+
38+ func searchConversations( _ text: String ) async throws -> SearchChatResponseDTO {
39+ fatalError ( " 사용 안 함 " )
40+ }
3341}
3442
3543@MainActor
3644final class ConversationListViewModelTests : XCTestCase {
3745 private func makeViewModel( repository: MockConversationRepository = MockConversationRepository ( ) ) -> ConversationListViewModel {
38- ConversationListViewModel ( getIncompleteConversationsUseCase: GetIncompleteConversationsUseCase ( conversationRepository: repository) )
46+ ConversationListViewModel (
47+ getIncompleteConversationsUseCase: GetIncompleteConversationsUseCase ( conversationRepository: repository) ,
48+ deleteConversationsUseCase: DefaultDeleteConversationsUseCase ( conversationRepository: repository) ,
49+ searchConversationUseCase: DefaultSearchConversationUseCase ( conversationRepository: repository)
50+ )
3951 }
4052
4153 func test_load_onSuccess_setsConversationsAndClearsLoading( ) async {
4254 let repository = MockConversationRepository ( )
43- let summary = ConversationSummary ( id: 1 , title: " 제목 " , status : " ACTIVE " , createdAt: Date ( timeIntervalSince1970: 0 ) )
55+ let summary = ConversationSummary ( id: 1 , title: " 제목 " , createdAt: Date ( timeIntervalSince1970: 0 ) )
4456 repository. stubbedGetConversationsResult = . success( [ summary] )
4557 let viewModel = makeViewModel ( repository: repository)
4658
4759 await viewModel. load ( )
4860
49- XCTAssertEqual ( viewModel. conversations , [ summary] )
61+ XCTAssertEqual ( viewModel. displayedConversations , [ summary] )
5062 XCTAssertFalse ( viewModel. isLoading)
5163 }
5264
0 commit comments