From d59a508190dbd15c09ed3263a20529e40573e39f Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sat, 11 Mar 2023 21:45:49 +0100 Subject: [PATCH] test for type: video --- test/index.ts | 8 ++++++++ test/oembed/oembed-video.json | 7 +++++++ 2 files changed, 15 insertions(+) create mode 100644 test/oembed/oembed-video.json diff --git a/test/index.ts b/test/index.ts index c457273..a8e7fb4 100644 --- a/test/index.ts +++ b/test/index.ts @@ -270,6 +270,14 @@ describe("oEmbed", () => { expect(summary.player.height).toBe(300); }); + test('type: video', async () => { + await setUpFastify('oembed-video.json'); + const summary = await summaly(host); + expect(summary.player.url).toBe('https://example.com/'); + expect(summary.player.width).toBe(500); + expect(summary.player.height).toBe(300); + }); + test('children are ignored', async () => { await setUpFastify('oembed-iframe-child.json'); const summary = await summaly(host); diff --git a/test/oembed/oembed-video.json b/test/oembed/oembed-video.json new file mode 100644 index 0000000..7537c7c --- /dev/null +++ b/test/oembed/oembed-video.json @@ -0,0 +1,7 @@ +{ + "version": "1.0", + "type": "video", + "html": "", + "width": 500, + "height": 300 +}