A music player that connects to your cloud/distributed storage.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at v4 42 lines 1.3 kB view raw
1import { describe, it } from "@std/testing/bdd"; 2import { expect } from "@std/expect"; 3 4import { testWeb } from "@tests/common/index.ts"; 5 6describe("components/artwork/input", () => { 7 it("delegates to input.artwork and returns null when input has no artwork", async () => { 8 const result = await testWeb(async () => { 9 const HttpsInput = await import("~/components/input/https/element.js"); 10 const InputArtwork = await import( 11 "~/components/artwork/input/element.js" 12 ); 13 14 const input = new HttpsInput.CLASS(); 15 input.id = "test-https-input-artwork"; 16 document.body.append(input); 17 18 const artwork = new InputArtwork.CLASS(); 19 artwork.setAttribute("input-selector", "#test-https-input-artwork"); 20 document.body.append(artwork); 21 22 await customElements.whenDefined(input.localName); 23 await customElements.whenDefined(artwork.localName); 24 25 const blob = await fetch("http://localhost:3000/testing/sample/audio.mp3") 26 .then((r) => r.blob()); 27 const blobUri = URL.createObjectURL(blob); 28 29 const result = await artwork.get({ 30 $type: "sh.diffuse.output.track" as const, 31 id: "input-artwork-test", 32 uri: blobUri, 33 }); 34 35 URL.revokeObjectURL(blobUri); 36 37 return result ?? null; 38 }); 39 40 expect(result).toBe(null); 41 }); 42});