mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 20:39:24 +00:00
unified the filtering of the gallery items
This commit is contained in:
@@ -12,8 +12,8 @@ import Testing
|
||||
struct MediaEventsTimelineScreenViewModelTests {
|
||||
@Test
|
||||
func changingScreenModeSwitchesTimelines() {
|
||||
let mediaTimelineViewModel = makeTimelineViewModel()
|
||||
let filesTimelineViewModel = makeTimelineViewModel()
|
||||
let mediaTimelineViewModel = makeTimelineViewModel(allowedGalleryItemTypes: [.image, .video])
|
||||
let filesTimelineViewModel = makeTimelineViewModel(allowedGalleryItemTypes: [.file, .audio])
|
||||
|
||||
let viewModel = MediaEventsTimelineScreenViewModel(mediaTimelineViewModel: mediaTimelineViewModel,
|
||||
filesTimelineViewModel: filesTimelineViewModel,
|
||||
@@ -45,10 +45,12 @@ struct MediaEventsTimelineScreenViewModelTests {
|
||||
|
||||
// MARK: - Helpers
|
||||
|
||||
// Both timelines are given the same mixed chunk of items so that the mode based filtering is what's under test.
|
||||
private func makeTimelineViewModel() -> TimelineViewModel {
|
||||
// Both timelines are given the same mixed chunk of items, filtered as they are in the app, so that
|
||||
// the filtering of the items is what's under test.
|
||||
private func makeTimelineViewModel(allowedGalleryItemTypes: [TimelineAllowedGalleryItemType]) -> TimelineViewModel {
|
||||
let timelineController = TimelineControllerMock(.init(timelineKind: .media(.mediaFilesScreen),
|
||||
timelineItems: [TimelineFixtures.separator] + TimelineFixtures.mediaChunk))
|
||||
timelineItems: [TimelineFixtures.separator] + TimelineFixtures.mediaChunk,
|
||||
allowedGalleryItemTypes: allowedGalleryItemTypes))
|
||||
return TimelineViewModel.mock(timelineKind: .media(.mediaFilesScreen), timelineController: timelineController)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user