mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Autoplay the next voice message if it is the next timeline item. (#6089)
This commit is contained in:
@@ -273,6 +273,23 @@ struct AudioPlayerStateTests {
|
||||
#expect(!audioPlayerState.showProgressIndicator)
|
||||
}
|
||||
|
||||
@Test
|
||||
mutating func audioPlayerActionsDidFinishPlayingWhenDetachedStraightAway() async throws {
|
||||
await audioPlayerState.updateState(progress: 0.4)
|
||||
audioPlayerState.attachAudioPlayer(audioPlayerMock)
|
||||
|
||||
let deferred = deferFulfillment(audioPlayerState.$progress) { $0 == 0.0 }
|
||||
|
||||
// Detaching before the action has been handled is what happens when the following
|
||||
// voice message takes the player over as soon as this one reaches its end.
|
||||
audioPlayerActionsSubject.send(.didFinishPlaying)
|
||||
audioPlayerState.detachAudioPlayer()
|
||||
|
||||
try await deferred.fulfill()
|
||||
#expect(audioPlayerState.progress == 0.0)
|
||||
#expect(!audioPlayerState.showProgressIndicator)
|
||||
}
|
||||
|
||||
@Test
|
||||
func setPlaybackSpeed() {
|
||||
audioPlayerState.attachAudioPlayer(audioPlayerMock)
|
||||
|
||||
Reference in New Issue
Block a user