Files
suaveplan/packages/ui/react/react-audio-player/tests/facade.test.tsx
2026-05-27 23:47:53 +01:00

39 lines
1.8 KiB
TypeScript

import { describe, expect, it } from "@suaveplan/testing/runner";
import * as RAP from "../src/index.js";
describe("@suaveplan/react-audio-player root barrel", () => {
it("exposes the namespaced ReactAudio re-export", { timeout: 5000 }, () => {
expect(RAP.ReactAudio).toBeDefined();
// The namespace must include the player components.
expect(typeof RAP.ReactAudio.AudioProvider).toBe("function");
expect(typeof RAP.ReactAudio.AudioPlayer).toBe("function");
expect(typeof RAP.ReactAudio.useTransport).toBe("function");
expect(typeof RAP.ReactAudio.useAnalyser).toBe("function");
expect(typeof RAP.ReactAudio.usePlaylist).toBe("function");
});
it("exposes the flat alias façade", { timeout: 5000 }, () => {
expect(typeof RAP.AudioPlayer).toBe("function");
expect(typeof RAP.AudioProvider).toBe("function");
expect(typeof RAP.BasicPlayer).toBe("function");
expect(typeof RAP.PremiumPlayer).toBe("function");
expect(typeof RAP.PresetManager).toBe("function");
expect(typeof RAP.TransportControls).toBe("function");
expect(typeof RAP.useAnalyser).toBe("function");
expect(typeof RAP.usePlaylist).toBe("function");
});
it("exposes karaoke surface from root", { timeout: 5000 }, () => {
expect(typeof RAP.parseLrc).toBe("function");
expect(typeof RAP.activeLyricIndex).toBe("function");
expect(typeof RAP.useLyrics).toBe("function");
expect(typeof RAP.LyricsDisplay).toBe("function");
});
it("exposes error-code surface from root", { timeout: 5000 }, () => {
expect(RAP.REACT_AUDIO_PLAYER_CODES).toBeDefined();
expect(typeof RAP.ReactAudioPlayerError).toBe("function");
expect(typeof RAP.registerReactAudioPlayerErrorCodes).toBe("function");
});
});