width cap
This commit is contained in:
@@ -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");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user