feat: add development certificate signing

Closes #4
This commit is contained in:
jychoi4 committed 2026-11-04 16:14:00 +09:00
1 parent fdbc9a9d1b
commit 024f244f52
10 files changed
+910 -3

No files matched your search

@@ -0,0 +1,20 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { renderSigningEditor, signingStatus } from '../src/signing-editor.ts';
test('signed packages keep trust status separate from signing', () => {
assert.equal(signingStatus('unsignedDevelopment'), '미서명');
assert.match(signingStatus('selfSignedDevelopment', { trustVerification: 'notTrusted' }), /신뢰 등록 필요/);
assert.match(signingStatus('selfSignedDevelopment', { trustVerification: 'passed' }), /현재 PC 신뢰 확인/);
assert.match(signingStatus('selfSignedDevelopment'), /신뢰 등록 필요/);
});
test('certificate selection escapes certificate data and locks actions during JSON editing', () => {
const certificate = { thumbprint: 'ABC', subject: '<img src=x>', notAfter: '2027-01-01', trustedPeople: false };
const html = renderSigningEditor('development', 'ABC', [certificate], true);
assert.ok(html.includes('value="ABC" selected'));
assert.ok(html.includes('&lt;img src=x&gt;'));
assert.ok(!html.includes('<img src=x>'));
assert.match(html, /data-action="certificate-create" disabled/);
assert.ok(!renderSigningEditor('unsigned', null, [], false).includes('data-action="certificate-create"'));
});