Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pngwn committed Jun 28, 2023
1 parent 62050f6 commit 17913bc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion js/app/src/components/Audio/Audio.test.ts
Expand Up @@ -218,7 +218,7 @@ describe("Audio", () => {
assert.equal(fn.callCount, 1);
});

test("when autoplay is true `media.play` should be called in static mode", async () => {
test("when autoplay is true `media.play` should be called in dynamic mode", async () => {
const { getByTestId } = await render(Audio, {
show_label: true,
loading_status,
Expand Down
8 changes: 5 additions & 3 deletions js/app/src/components/Video/Video.test.ts
Expand Up @@ -9,8 +9,7 @@ import {
expect
} from "vitest";
import { spyOn } from "tinyspy";
import { cleanup, render, wait_for_event, wait } from "@gradio/tootils";
import event from "@testing-library/user-event";
import { cleanup, render } from "@gradio/tootils";
import { setupi18n } from "../../i18n";

import Video from "./Video.svelte";
Expand Down Expand Up @@ -134,7 +133,8 @@ describe("Video", () => {
startButton.dispatchEvent(new Event("loadeddata"));
assert.equal(fn.callCount, 1);
});
test("when autoplay is true `media.play` should be called in static mode", async () => {

test("when autoplay is true `media.play` should be called in dynamic mode", async () => {
const { getByTestId } = await render(Video, {
show_label: true,
loading_status,
Expand All @@ -158,6 +158,7 @@ describe("Video", () => {
startButton.dispatchEvent(new Event("loadeddata"));
assert.equal(fn.callCount, 1);
});

test("when autoplay is true `media.play` should be called in static mode when the Video data is updated", async () => {
const { component, getByTestId } = await render(Video, {
show_label: true,
Expand Down Expand Up @@ -190,6 +191,7 @@ describe("Video", () => {
startButton.dispatchEvent(new Event("loadeddata"));
assert.equal(fn.callCount, 2);
});

test("when autoplay is true `media.play` should be called in dynamic mode when the Video data is updated", async () => {
const { component, getByTestId } = await render(Video, {
show_label: true,
Expand Down
1 change: 0 additions & 1 deletion js/video/src/utils.ts
Expand Up @@ -24,7 +24,6 @@ export function loaded(
): ActionReturn {
async function handle_playback(): Promise<void> {
if (!autoplay) return;
// node.pause();
await node.play();
}

Expand Down

0 comments on commit 17913bc

Please sign in to comment.