From 491df542429664a749ecdf8e8f308e13d566d8c0 Mon Sep 17 00:00:00 2001 From: WebStreamr <210764791+webstreamr@users.noreply.github.com> Date: Mon, 11 Aug 2025 08:37:07 +0000 Subject: [PATCH] chore(manifest): sort sources for each language in configuration --- src/utils/__snapshots__/manifest.test.ts.snap | 8 ++++---- src/utils/manifest.test.ts | 4 +++- src/utils/manifest.ts | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/utils/__snapshots__/manifest.test.ts.snap b/src/utils/__snapshots__/manifest.test.ts.snap index 195c648..8908744 100644 --- a/src/utils/__snapshots__/manifest.test.ts.snap +++ b/src/utils/__snapshots__/manifest.test.ts.snap @@ -36,7 +36,7 @@ exports[`buildManifest default manifest 1`] = ` }, { "key": "it", - "title": "Italian 🇮🇹 (VixSrc, Eurostreaming, MostraGuarda)", + "title": "Italian 🇮🇹 (Eurostreaming, MostraGuarda, VixSrc)", "type": "checkbox", }, { @@ -84,7 +84,7 @@ exports[`buildManifest default manifest 1`] = ` "movie", "series", ], - "version": "0.41.3", + "version": Any, } `; @@ -160,7 +160,7 @@ exports[`buildManifest has checked source with appropriate config 1`] = ` { "default": "checked", "key": "de", - "title": "German 🇩🇪 (StreamKiste, MeineCloud)", + "title": "German 🇩🇪 (MeineCloud, StreamKiste)", "type": "checkbox", }, { @@ -208,7 +208,7 @@ exports[`buildManifest has unchecked source without a config 1`] = ` }, { "key": "de", - "title": "German 🇩🇪 (StreamKiste, MeineCloud)", + "title": "German 🇩🇪 (MeineCloud, StreamKiste)", "type": "checkbox", }, { diff --git a/src/utils/manifest.test.ts b/src/utils/manifest.test.ts index 0e73ea6..bbe709d 100644 --- a/src/utils/manifest.test.ts +++ b/src/utils/manifest.test.ts @@ -15,7 +15,9 @@ describe('buildManifest', () => { test('default manifest', async () => { const manifest = buildManifest(createSources(fetcher), [], {}); - expect(manifest).toMatchSnapshot(); + expect(manifest).toMatchSnapshot({ + version: expect.any(String), + }); }); test('has unchecked source without a config', () => { diff --git a/src/utils/manifest.ts b/src/utils/manifest.ts index a371105..8936eb9 100644 --- a/src/utils/manifest.ts +++ b/src/utils/manifest.ts @@ -56,7 +56,7 @@ export const buildManifest = (sources: Source[], extractors: Extractor[], config manifest.config.push({ key: countryCode, type: 'checkbox', - title: `${language} ${flagFromCountryCode(countryCode)} (${(sources as Source[]).map(handler => handler.label).join(', ')})`, + title: `${language} ${flagFromCountryCode(countryCode)} (${(sources as Source[]).map(handler => handler.label).sort().join(', ')})`, ...(countryCode in config && { default: 'checked' }), }); }