Fix seekbar position for zero length audio (#9949)
This commit is contained in:
parent
51b4555106
commit
ed06ed0185
5 changed files with 38 additions and 3 deletions
|
@ -34,15 +34,29 @@ describe("SeekBar", () => {
|
|||
frameRequestCallback = callback;
|
||||
return 0;
|
||||
});
|
||||
playback = createTestPlayback();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
mocked(window.requestAnimationFrame).mockRestore();
|
||||
});
|
||||
|
||||
describe("when rendering a SeekBar for an empty playback", () => {
|
||||
beforeEach(() => {
|
||||
playback = createTestPlayback({
|
||||
durationSeconds: 0,
|
||||
timeSeconds: 0,
|
||||
});
|
||||
renderResult = render(<SeekBar ref={seekBarRef} playback={playback} />);
|
||||
});
|
||||
|
||||
it("should render correctly", () => {
|
||||
expect(renderResult.container).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
describe("when rendering a SeekBar", () => {
|
||||
beforeEach(() => {
|
||||
playback = createTestPlayback();
|
||||
renderResult = render(<SeekBar ref={seekBarRef} playback={playback} />);
|
||||
});
|
||||
|
||||
|
|
|
@ -15,6 +15,21 @@ exports[`SeekBar when rendering a SeekBar and the playback proceeds should rende
|
|||
</div>
|
||||
`;
|
||||
|
||||
exports[`SeekBar when rendering a SeekBar for an empty playback should render correctly 1`] = `
|
||||
<div>
|
||||
<input
|
||||
class="mx_SeekBar"
|
||||
max="1"
|
||||
min="0"
|
||||
step="0.001"
|
||||
style="--fillTo: 0;"
|
||||
tabindex="0"
|
||||
type="range"
|
||||
value="0"
|
||||
/>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`SeekBar when rendering a SeekBar should render the initial position 1`] = `
|
||||
<div>
|
||||
<input
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue