You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-31 13:44:28 +03:00
Add voice broadcast playback seekbar (#9529)
This commit is contained in:
@ -65,6 +65,18 @@ describe("VoiceBroadcastChunkEvents", () => {
|
||||
expect(chunkEvents.getLength()).toBe(3259);
|
||||
});
|
||||
|
||||
it("getLengthTo(first event) should return 0", () => {
|
||||
expect(chunkEvents.getLengthTo(eventSeq1Time1)).toBe(0);
|
||||
});
|
||||
|
||||
it("getLengthTo(some event) should return the time excl. that event", () => {
|
||||
expect(chunkEvents.getLengthTo(eventSeq3Time2)).toBe(7 + 3141);
|
||||
});
|
||||
|
||||
it("getLengthTo(last event) should return the time excl. that event", () => {
|
||||
expect(chunkEvents.getLengthTo(eventSeq4Time1)).toBe(7 + 3141 + 42);
|
||||
});
|
||||
|
||||
it("should return the expected next chunk", () => {
|
||||
expect(chunkEvents.getNext(eventSeq2Time4Dup)).toBe(eventSeq3Time2);
|
||||
});
|
||||
@ -72,6 +84,18 @@ describe("VoiceBroadcastChunkEvents", () => {
|
||||
it("should return undefined for next last chunk", () => {
|
||||
expect(chunkEvents.getNext(eventSeq4Time1)).toBeUndefined();
|
||||
});
|
||||
|
||||
it("findByTime(0) should return the first chunk", () => {
|
||||
expect(chunkEvents.findByTime(0)).toBe(eventSeq1Time1);
|
||||
});
|
||||
|
||||
it("findByTime(some time) should return the chunk with this time", () => {
|
||||
expect(chunkEvents.findByTime(7 + 3141 + 21)).toBe(eventSeq3Time2);
|
||||
});
|
||||
|
||||
it("findByTime(entire duration) should return the last chunk", () => {
|
||||
expect(chunkEvents.findByTime(7 + 3141 + 42 + 69)).toBe(eventSeq4Time1);
|
||||
});
|
||||
});
|
||||
|
||||
describe("when adding events where at least one does not have a sequence", () => {
|
||||
|
Reference in New Issue
Block a user