fix(updater): dispatch setFeedURL by provider instead of raw url

This commit is contained in:
2026-06-08 07:11:28 +05:30
parent aeadde5f40
commit 6df1389cc8
4 changed files with 36 additions and 11 deletions
+18 -2
View File
@@ -1,4 +1,4 @@
const { resolveFeedUrl, FEEDS } = require('../../../../src/main/updater/feed-config');
const { resolveFeedUrl, feedConfigFor, FEEDS } = require('../../../../src/main/updater/feed-config');
describe('feed-config', () => {
test('resolves github channel to GitHub Releases feed', () => {
@@ -30,4 +30,20 @@ describe('feed-config', () => {
expect(FEEDS.github).toBeDefined();
expect(FEEDS.concreteinfo).toBeDefined();
});
});
});
describe('feedConfigFor', () => {
test('returns github provider config for github channel', () => {
const config = feedConfigFor('github');
expect(config).toEqual({ provider: 'github', owner: 'amitwh', repo: 'markdown-converter' });
});
test('returns generic provider config for concreteinfo channel', () => {
const config = feedConfigFor('concreteinfo');
expect(config).toEqual({ provider: 'generic', url: 'https://updates.concreteinfo.co.in/v5' });
});
test('falls back to generic provider on unknown channel', () => {
const config = feedConfigFor('something-weird');
expect(config).toEqual({ provider: 'generic', url: 'https://updates.concreteinfo.co.in/v5' });
});
});