width cap
Some checks failed
Build & Push Docker (latest) / build (push) Has been cancelled
Build & Push Docker (latest) / verify (push) Has been cancelled

This commit is contained in:
Aiden Wilson
2026-05-29 22:46:56 +10:00
parent 4595e782c8
commit a88306aec7
7 changed files with 575 additions and 20 deletions

View File

@@ -32,9 +32,16 @@ test("flattens providers and finds a matching provider", () => {
});
test("builds oEmbed provider request URLs", () => {
const url = buildOembedUrl("https://example.com/oembed", "https://video.example.com/watch?id=1", 1280);
const url = buildOembedUrl("https://example.com/oembed", "https://video.example.com/watch?id=1", 500, 480);
assert.equal(url.searchParams.get("url"), "https://video.example.com/watch?id=1");
assert.equal(url.searchParams.get("format"), "json");
assert.equal(url.searchParams.get("maxwidth"), "1280");
assert.equal(url.searchParams.get("maxwidth"), "500");
assert.equal(url.searchParams.get("maxheight"), "480");
});
test("caps all oEmbed maxwidth values to 500", () => {
const url = buildOembedUrl("https://example.com/oembed", "https://video.example.com/watch?id=1", 1280);
assert.equal(url.searchParams.get("maxwidth"), "500");
});