Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Playback Interactor, Presenter 테스트 코드 작성 #320

Closed
wants to merge 16 commits into from

Conversation

chopmozzi
Copy link
Collaborator

🧑‍🚀 PR 요약

�Playback Interacotr와 Presenter의 테스트 코드를 작성했습니다.
ViewController는 아직 못했습니다. 정신 나갈것 같아요.
구조이슈........로 테스트 안되는 케이스들이 두갠가 있습니다.
이 친구들은 버그 고치고, 정신 좀 말짱할 때 할 게요.

📸 ScreenShot

스크린샷 2023-12-13 오전 1 58 18

Linked Issue

close #311

@chopmozzi chopmozzi added this to the iOS milestone Dec 12, 2023
@chopmozzi chopmozzi self-assigned this Dec 12, 2023
@loinsir
Copy link
Collaborator

loinsir commented Dec 12, 2023

ViewController는 아직 못했습니다.

뷰는 테스트 안해주셔도 됩니다!

if post.board.videoURL == nil {
continue
}
tempVideos.append(post)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if let 써서 videoURL있을 때만 append하는게 더 직관적일 것 같은 느낌?

Copy link
Member

@anyukyung anyukyung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

재생화면이 케이스가 엄청 많네요.. 고생하셨습니다
빌드 fail하는 테케는 머지하시고 고치실 예정인가요 !

@chopmozzi
Copy link
Collaborator Author

@anyukyung 아뇨 지금 최대한 고쳐볼게용....


// MARK: - Tests

func test_displayVideoList를_호출하면_presentVideoList를_호출하고_올바른_데이터를_전달한다_parentView가_map일_때() async {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

자연스럽게 읽힐 수 있도록 ~~일 때 라는 말이 어순으로 들어오면 좋을 것 같습니다

// videos는 Hashable
XCTAssertEqual(spy.displayVideoListViewModel.videos.first!, Seeds.PlaybackVideos.videos.first!)
XCTAssertEqual(spy.displayVideoListViewModel.videos.last!, Seeds.PlaybackVideos.videos.last!)
XCTAssertEqual(spy.displayVideoListViewModel.videos.count, 2)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

count 체크가 선행되어서, 실패 시 뒤 로직을 실행하지 못하게 하면 테스트 시간을 단축할 수 있을 것 같습니다.

let response: Models.SeekVideo.Response = Models.SeekVideo.Response(willMoveLocation: willMoveLocation, currentCell: previousCell)
presenter?.presentSeekVideo(with: response)
}

func hidePlayerSlider() {
guard let previousCell else { return }
previousCell.playbackView.playerSlider?.isHidden = true
Copy link
Collaborator

@loinsir loinsir Dec 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이건 interactor에서 뷰를 조작하는 동작일까요...?

Copy link
Collaborator

@loinsir loinsir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다. 테스트 케이스가 너무 많군요....ㅠㅠ

@chopmozzi
Copy link
Collaborator Author

@loinsir @anyukyung 저 이 브랜치 Pr 닫고 브랜치 새로 파서 진행할게요. 어디서부터 꼬였는지 감도 안잡혀요 지금

@chopmozzi chopmozzi closed this Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants