test(electron): align xtream epg schedule expectation

This commit is contained in:
4gray committed 2026-05-22 14:59:10 +03:00
1 parent 0fb4c7d13e
commit 189daea3fa
1 file changed
+1 -18
@@ -12,7 +12,6 @@ import {
} from './electron-test-fixtures';
import {
fetchXtreamEpgFixture,
XtreamEpgFixture,
XtreamNormalizedEpgListing,
} from './portal-mock-fixtures';
@@ -87,7 +86,7 @@ for (const timeZone of ['UTC', 'Europe/Berlin'] as const) {
});
const currentDateKey = formatDateKeyInZone(Date.now(), timeZone);
const currentDayTitles = visibleTitlesForCurrentDate(
const currentDayTitles = titlesForDate(
fixture.fullEpg,
currentDateKey,
timeZone
@@ -184,22 +183,6 @@ function titlesForDate(
.map((listing) => listing.title);
}
function visibleTitlesForCurrentDate(
listings: XtreamNormalizedEpgListing[],
currentDateKey: string,
timeZone: string
): string[] {
const nowSeconds = Math.floor(Date.now() / 1000);
return listings
.filter(
(listing) =>
formatDateKeyInZone(listing.startTimestamp * 1000, timeZone) ===
currentDateKey && listing.stopTimestamp >= nowSeconds
)
.map((listing) => listing.title);
}
function getFirstFutureDateKey(
listings: XtreamNormalizedEpgListing[],
currentDateKey: string,