Login lives encrypted in the database (Instellingen → OpenF1) so the phone can use live data without env secrets.
24 lines
1.1 KiB
TypeScript
24 lines
1.1 KiB
TypeScript
import assert from "node:assert/strict";
|
|
import { parseRacingNews365 } from "./news";
|
|
|
|
const html = `
|
|
<a href="https://racingnews365.nl/f1-nieuws" class="card card--default">skip</a>
|
|
<a
|
|
href="https://racingnews365.nl/hadjar-doet-boekje-open-over-polsbreuk-heel-stom"
|
|
class="card card--default
|
|
"
|
|
data-id="14443134"
|
|
>
|
|
<span class="card__title"><span data-ab-title="14443134">Hadjar doet boekje open over polsbreuk: "Heel stom"</span></span>
|
|
<time datetime="2026-09-30T20:30:00+02:00">30 september 20:30</time>
|
|
<img srcset="https://cdn.racingnews365.com/2026/Hadjar/XPB.jpg?width=360&height=203 1x">
|
|
</a>
|
|
<a href="https://racingnews365.nl/coureurs" class="card card--default"><span data-ab-title="1">Coureurs</span></a>
|
|
`;
|
|
|
|
const items = parseRacingNews365(html);
|
|
assert.equal(items.length, 1);
|
|
assert.equal(items[0].title, 'Hadjar doet boekje open over polsbreuk: "Heel stom"');
|
|
assert.equal(items[0].id, "14443134");
|
|
assert.ok(items[0].imageUrl?.includes("cdn.racingnews365.com"));
|
|
console.log("openf1/news.test.ts ok");
|