Skip to content

Commit

Permalink
✅ PlaybackPresenter Test Update
Browse files Browse the repository at this point in the history
  • Loading branch information
chopmozzi committed Jan 8, 2024
1 parent 77c62a8 commit 72e548a
Show file tree
Hide file tree
Showing 5 changed files with 469 additions and 10 deletions.
12 changes: 12 additions & 0 deletions iOS/Layover/Layover.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
835A61A22B068115002F22A5 /* PlaybackInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 835A619C2B068115002F22A5 /* PlaybackInteractor.swift */; };
835A61A62B0B4DDD002F22A5 /* Dashboard-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 835A61A52B0B4DDD002F22A5 /* Dashboard-Regular.ttf */; };
835A61A92B0B5A31002F22A5 /* LoginConfigurator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 835A61A82B0B5A31002F22A5 /* LoginConfigurator.swift */; };
8363A32D2B4C1CBB00772DDF /* PlaybackPresenterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8363A32C2B4C1CBA00772DDF /* PlaybackPresenterTests.swift */; };
836C33872B15A29600ECAFB0 /* Toast.swift in Sources */ = {isa = PBXBuildFile; fileRef = 836C33862B15A29600ECAFB0 /* Toast.swift */; };
836C338B2B15D22C00ECAFB0 /* PlaybackConfigurator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 836C338A2B15D22C00ECAFB0 /* PlaybackConfigurator.swift */; };
836C33912B17629400ECAFB0 /* MapRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 836C33902B17629400ECAFB0 /* MapRouter.swift */; };
Expand Down Expand Up @@ -402,6 +403,7 @@
835A61A52B0B4DDD002F22A5 /* Dashboard-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Dashboard-Regular.ttf"; sourceTree = "<group>"; };
835A61A82B0B5A31002F22A5 /* LoginConfigurator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginConfigurator.swift; sourceTree = "<group>"; };
835A61AA2B0B85FD002F22A5 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
8363A32C2B4C1CBA00772DDF /* PlaybackPresenterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = PlaybackPresenterTests.swift; path = LayoverTests/Mocks/Workers/PlaybackPresenterTests.swift; sourceTree = SOURCE_ROOT; };
836C33862B15A29600ECAFB0 /* Toast.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Toast.swift; sourceTree = "<group>"; };
836C338A2B15D22C00ECAFB0 /* PlaybackConfigurator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaybackConfigurator.swift; sourceTree = "<group>"; };
836C33902B17629400ECAFB0 /* MapRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapRouter.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -619,6 +621,7 @@
194C21C72B1DF09B00C62645 /* Scenes */ = {
isa = PBXGroup;
children = (
8363A32B2B4C1C6900772DDF /* Playback */,
19AE481D2B29D02700DD4612 /* EditProfile */,
19AE48122B28C2A800DD4612 /* Setting */,
192513632B26F7BB001533FA /* TagPlayList */,
Expand Down Expand Up @@ -869,6 +872,14 @@
path = Playback;
sourceTree = "<group>";
};
8363A32B2B4C1C6900772DDF /* Playback */ = {
isa = PBXGroup;
children = (
8363A32C2B4C1CBA00772DDF /* PlaybackPresenterTests.swift */,
);
path = Playback;
sourceTree = "<group>";
};
836C33922B18436A00ECAFB0 /* Setting */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1595,6 +1606,7 @@
192513802B277CD7001533FA /* ProfileViewControllerTests.swift in Sources */,
194C21C62B1DEE6B00C62645 /* HomePresenterTests.swift in Sources */,
FC4E0C202B28B4C500152596 /* MockLocationFetcher.swift in Sources */,
8363A32D2B4C1CBB00772DDF /* PlaybackPresenterTests.swift in Sources */,
1925137A2B273D98001533FA /* StubAuthManager.swift in Sources */,
1925136D2B26F84E001533FA /* MockTagPlayListWorker.swift in Sources */,
19AE481A2B28C2B700DD4612 /* SettingPresenterTests.swift in Sources */,
Expand Down
5 changes: 0 additions & 5 deletions iOS/Layover/Layover/Scenes/Playback/PlaybackPresenter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import Foundation
protocol PlaybackPresentationLogic {
func presentVideoList(with response: PlaybackModels.LoadPlaybackVideoList.Response)
func presentLoadFetchVideos(with response: PlaybackModels.LoadPlaybackVideoList.Response)
func presentSetCellIfInfinite(with response: PlaybackModels.SetInitialPlaybackCell.Response)
func presentMoveCellNext(with response: PlaybackModels.DisplayPlaybackVideo.Response)
func presentSetInitialPlaybackCell(with response: PlaybackModels.SetInitialPlaybackCell.Response)
func presentMoveInitialPlaybackCell(with response: PlaybackModels.SetInitialPlaybackCell.Response)
Expand Down Expand Up @@ -50,10 +49,6 @@ final class PlaybackPresenter: PlaybackPresentationLogic {
viewController?.loadFetchVideos(viewModel: viewModel)
}

func presentSetCellIfInfinite(with response: PlaybackModels.SetInitialPlaybackCell.Response) {
viewController?.displayMoveCellIfinfinite(viewModel: Models.SetInitialPlaybackCell.ViewModel(indexPathRow: response.indexPathRow))
}

// MARK: - UseCase Set Init Playback Scene

func presentSetInitialPlaybackCell(with response: PlaybackModels.SetInitialPlaybackCell.Response) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ protocol PlaybackViewControllerDelegate: AnyObject {
protocol PlaybackDisplayLogic: AnyObject {
func displayVideoList(viewModel: PlaybackModels.LoadPlaybackVideoList.ViewModel)
func loadFetchVideos(viewModel: PlaybackModels.LoadPlaybackVideoList.ViewModel)
func displayMoveCellIfinfinite(viewModel: PlaybackModels.SetInitialPlaybackCell.ViewModel)
func stopPrevPlayerAndPlayCurPlayer(viewModel: PlaybackModels.DisplayPlaybackVideo.ViewModel)
func setInitialPlaybackCell(viewModel: PlaybackModels.SetInitialPlaybackCell.ViewModel)
func moveInitialPlaybackCell(viewModel: PlaybackModels.SetInitialPlaybackCell.ViewModel)
Expand Down Expand Up @@ -215,10 +214,6 @@ extension PlaybackViewController: PlaybackDisplayLogic {
dataSource?.apply(currentSnapshot, animatingDifferences: true)
}

func displayMoveCellIfinfinite(viewModel: Models.SetInitialPlaybackCell.ViewModel) {
playbackCollectionView.setContentOffset(.init(x: playbackCollectionView.contentOffset.x, y: playbackCollectionView.bounds.height * CGFloat(viewModel.indexPathRow)), animated: false)
}

func stopPrevPlayerAndPlayCurPlayer(viewModel: PlaybackModels.DisplayPlaybackVideo.ViewModel) {
guard let tabBarHeight: CGFloat = self.tabBarController?.tabBar.frame.height else { return }
if let previousCell = viewModel.previousCell {
Expand Down
Loading

0 comments on commit 72e548a

Please sign in to comment.