1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-31 13:44:28 +03:00

Broadcast time left should never be negative (#10070)

This commit is contained in:
Michael Weimann
2023-02-03 13:49:43 +01:00
committed by GitHub
parent 27bd04a875
commit cfba1b07c6
2 changed files with 17 additions and 1 deletions

View File

@ -525,6 +525,20 @@ describe("VoiceBroadcastPlayback", () => {
it("should update the time", () => {
expect(playback.timeSeconds).toBe(11);
expect(playback.timeLeftSeconds).toBe(2);
});
});
describe("and the chunk playback progresses across the actual time", () => {
// This can be the case if the meta data is out of sync with the actual audio data.
beforeEach(() => {
chunk1Playback.clockInfo.liveData.update([15]);
});
it("should update the time", () => {
expect(playback.timeSeconds).toBe(15);
expect(playback.timeLeftSeconds).toBe(0);
});
});