Skip to content

Commit 84b4a74

Browse files
committed
test: Corriger les tests de L'Internaute.
1 parent e45317f commit 84b4a74

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

test/integration/scraper/linternaute.js

+24-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import assert from "node:assert";
2+
import sinon from "sinon";
3+
import { kodi } from "../../../src/core/kodi.js";
24
import { extract } from "../../../src/core/scrapers.js";
35

46
describe("Scraper: L'Internaute", function () {
@@ -13,13 +15,30 @@ describe("Scraper: L'Internaute", function () {
1315
});
1416

1517
it("should return video URL [ldjson]", async function () {
16-
const url = new URL("https://www.linternaute.fr/cinema/tous-les-films" +
17-
"/2424867-les-enfants-du-temps/");
18+
const url = new URL("https://www.linternaute.com/sport/rugby" +
19+
"/2617245-rugby-france-angleterre-suivez" +
20+
"-le-match-des-6-nations-en-direct/");
1821
const options = { depth: false, incognito: false };
1922

2023
const file = await extract(url, options);
21-
assert.ok(file?.startsWith("https://media.ccmbg.com/vc/767071118" +
22-
"/852438/mp4/"),
23-
`"${file}"?.startsWith(...)`);
24+
assert.strictEqual(file,
25+
"https://media.ccmbg.com/vc/8654741851/960911/mp4/1647588853");
26+
});
27+
28+
it("should return video URL [iframe-youtube]", async function () {
29+
const stub = sinon.stub(kodi.addons, "getAddons").resolves([]);
30+
31+
const url = new URL("https://www.linternaute.fr/cinema/pratique" +
32+
"/2595113-alerte-rouge-a-partir-de-quel" +
33+
"-age-voir-le-dernier-film-pixar/");
34+
const options = { depth: false, incognito: false };
35+
36+
const file = await extract(url, options);
37+
assert.strictEqual(file,
38+
"plugin://plugin.video.youtube/play/" +
39+
"?video_id=cMAiO2X12tk&incognito=false");
40+
41+
assert.strictEqual(stub.callCount, 1);
42+
assert.deepStrictEqual(stub.firstCall.args, ["video"]);
2443
});
2544
});

0 commit comments

Comments
 (0)