Release ForgeFlow 0.8.1
Add advanced Git and deployment workflows, secure backups and auditing, live Gitea integration, desktop notifications, connection validation, and the premium responsive UX refresh.
This commit is contained in:
@@ -88,3 +88,22 @@ test('checks repository workflow files through the contents API', async () => {
|
||||
service.request = async () => { const error = new Error('missing'); error.status = 404; throw error; };
|
||||
assert.equal(await service.repositoryFileExists({ owner: 'jens', repo: 'app', filePath: '.gitea/workflows/missing.yml', ref: 'main' }), false);
|
||||
});
|
||||
|
||||
test('creates controlled pull requests and reads branch protection', async () => {
|
||||
const service = new GiteaService(makeStore());
|
||||
const calls = [];
|
||||
service.request = async (pathname, options = {}) => {
|
||||
calls.push({ pathname, options });
|
||||
if (pathname.includes('/branches/main')) return { data: { name: 'main', protected: true } };
|
||||
if (pathname.endsWith('/branch_protections')) return { data: [{ branch_name: 'main', required_approvals: 2, require_signed_commits: true }] };
|
||||
return { data: { number: 12, html_url: 'https://gitea.test/owner/app/pulls/12' } };
|
||||
};
|
||||
const protection = await service.getBranchProtection('owner', 'app', 'main');
|
||||
assert.equal(protection.protected, true);
|
||||
assert.equal(protection.requiredApprovals, 2);
|
||||
const pull = await service.createPullRequest({ owner: 'owner', repo: 'app', head: 'feature', base: 'main', title: 'Release feature', body: 'Summary' });
|
||||
assert.equal(pull.number, 12);
|
||||
const create = calls.find((call) => call.options.method === 'POST');
|
||||
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/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user