Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Throw helpful error when media devices are not found (#5794)
* add test * add changeset * tweak copy * error logic * add changeset * copy tweak --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
- Loading branch information
1 parent
ed0f9a2
commit f096c3a
Showing
4 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@gradio/app": patch | ||
"@gradio/audio": patch | ||
"gradio": patch | ||
--- | ||
|
||
fix:Throw helpful error when media devices are not found |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { test, describe, assert, afterEach } from "vitest"; | ||
import { cleanup, render } from "@gradio/tootils"; | ||
import Audio from "./static"; | ||
import type { LoadingStatus } from "@gradio/statustracker"; | ||
import { setupi18n } from "../app/src/i18n"; | ||
|
||
const loading_status: LoadingStatus = { | ||
eta: 0, | ||
queue_position: 1, | ||
queue_size: 1, | ||
status: "complete", | ||
scroll_to_output: false, | ||
visible: true, | ||
fn_index: 0, | ||
show_progress: "full" | ||
}; | ||
|
||
describe("Audio", () => { | ||
setupi18n(); | ||
|
||
afterEach(() => cleanup()); | ||
|
||
test("renders audio component", async () => { | ||
const { getAllByTestId } = await render(Audio, { | ||
loading_status, | ||
label: "music", | ||
value: "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3", | ||
root: "", | ||
root_url: "", | ||
theme_mode: "dark" | ||
}); | ||
|
||
assert.exists(getAllByTestId("music-audio")); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters