Release ForgeFlow 0.8.8 Gitea asset route fix

This commit is contained in:
NuklearRabbit
2026-07-26 04:50:50 +02:00
parent 40d41f9a32
commit e888bd2c1c
11 changed files with 75 additions and 21 deletions
+19
View File
@@ -107,3 +107,22 @@ test('creates controlled pull requests and reads branch protection', async () =>
assert.deepEqual(create.options.body, { head: 'feature', base: 'main', title: 'Release feature', body: 'Summary' });
await assert.rejects(() => service.createPullRequest({ owner: 'owner', repo: 'app', head: 'main', base: 'main', title: 'Invalid' }), /different/);
});
test('downloads release assets through the release-scoped Gitea endpoint', async () => {
const service = new GiteaService(makeStore());
let requested = '';
service.downloadAuthenticated = async (pathname) => {
requested = pathname;
return Buffer.from('asset');
};
const asset = await service.downloadReleaseAsset('Jens', 'ForgeFlow', 107, 412);
assert.equal(asset.toString(), 'asset');
assert.equal(
requested,
'/api/v1/repos/Jens/ForgeFlow/releases/107/assets/412',
);
await assert.rejects(
() => service.downloadReleaseAsset('Jens', 'ForgeFlow', null, 412),
/invalid release ID/,
);
});