فینورا پرو - سامانه جامع حسابداری و صدور فاکتور

test(release): fail closed on injected gate and URL suffixes

davoodmehraban89 committed Oct 19, 2026 at 01:41 UTC 8eb3c4240bd2396afd481d1d1d04818a3cb423d1
1 file changed +22
tests/phase-a-release-gate.test.mjs
+22
@@ -39,3 +39,25 @@ test('release gate: duplicate and missing acceptance entries fail closed', () =>
39 accepted.requirements.pop();
40 assert.throws(() => verifyPhaseARelease({ ...args, acceptance: accepted }), /unaccepted/);
41 });
42 +
43 +test('release gate: extra gate and malformed evidence suffixes fail closed', () => {
44 + const acceptance = structuredClone(manifest);
45 + for (const row of acceptance.requirements) {
46 + row.accepted = true;
47 + row.evidence = ['https://github.com/davoodmehraban89/Factor-easyPro/actions/runs/123'];
48 + }
49 + acceptance.requirements.push({
50 + id: 'UNREVIEWED', accepted: true,
51 + evidence: ['https://github.com/davoodmehraban89/Factor-easyPro/issues/1']
52 + });
53 + assert.throws(() => verifyPhaseARelease({ ...args, acceptance }), /Unexpected/);
54 + acceptance.requirements.pop();
55 + for (const invalid of [
56 + 'https://github.com/davoodmehraban89/Factor-easyPro/actions/runs/123/extra',
57 + 'https://github.com/davoodmehraban89/Factor-easyPro/issues/123?fake=1',
58 + 'https://github.com/davoodmehraban89/Factor-easyPro/pull/0'
59 + ]) {
60 + acceptance.requirements[0].evidence = [invalid];
61 + assert.throws(() => verifyPhaseARelease({ ...args, acceptance }), /unaccepted/);
62 + }
63 +});