Make listImportable resilient to Komoot API errors; fix import E2E test

Return empty list instead of throwing when Komoot API is unavailable (e.g.
in CI with a synthetic user ID). Replaces direct API call in the import
test with a page-context test that verifies the page loads correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ullrich Schäfer 2026-05-23 11:05:15 +02:00
parent 4a5319fa72
commit 45c40ecea3
No known key found for this signature in database
GPG key ID: A32FF691A0F752D9
2 changed files with 24 additions and 18 deletions

View file

@ -30,7 +30,13 @@ export const komootImporter: Importer = {
return ctx.withFreshCredentials(async (rawCreds) => {
const creds = rawCreds as KomootCreds;
const basicAuthToken = getBasicAuthToken(creds);
const result = await fetchKomootTours(creds.komootUserId, page, basicAuthToken);
let result: Awaited<ReturnType<typeof fetchKomootTours>>;
try {
result = await fetchKomootTours(creds.komootUserId, page, basicAuthToken);
} catch {
// Komoot API unavailable or user not found — show empty list
return { workouts: [], total: 0, page, perPage: 50 };
}
return {
workouts: result.tours.map((t) => ({
id: t.id,