Refractoring Stage 5 Moved the OpenPGP and DAV IPC handlers into desktop/ipc/pgp.cjs and desktop/ipc/dav.cjs.
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const { registerPgpIpcHandlers } = require('../desktop/ipc/pgp.cjs');
|
||||
|
||||
test('registers the complete OpenPGP IPC surface through the shared boundary', () => {
|
||||
const registered = [];
|
||||
registerPgpIpcHandlers({
|
||||
registerIpcHandler(channel, handler) { registered.push({ channel, handler }); },
|
||||
BrowserWindow: {},
|
||||
dialog: {},
|
||||
fs: {},
|
||||
openpgp: {},
|
||||
pgpKeys: {},
|
||||
pgpCache: {},
|
||||
pgpMail: {},
|
||||
PgpError: class PgpError extends Error {},
|
||||
pgpKeyServers: {},
|
||||
listServers() {},
|
||||
MAX_CUSTOM_SERVERS: 10,
|
||||
normalizeCustomServer() {},
|
||||
randomUUID() {},
|
||||
readAccount() {},
|
||||
imapClient() {},
|
||||
folderPath() {},
|
||||
simpleParser() {},
|
||||
extractMailContent() {}
|
||||
});
|
||||
|
||||
const channels = registered.map(item => item.channel).sort();
|
||||
assert.deepEqual(channels, [
|
||||
'pgp:add-contact', 'pgp:add-key-server', 'pgp:change-passphrase', 'pgp:check-send',
|
||||
'pgp:contacts', 'pgp:decrypt-message', 'pgp:delete', 'pgp:export-contact',
|
||||
'pgp:export-private', 'pgp:export-public', 'pgp:export-revocation', 'pgp:find-key',
|
||||
'pgp:forget-passphrases', 'pgp:generate', 'pgp:get-settings', 'pgp:import',
|
||||
'pgp:key-servers', 'pgp:list', 'pgp:publish-key', 'pgp:remove-contact',
|
||||
'pgp:remove-key-server', 'pgp:set-key-server-enabled', 'pgp:set-settings', 'pgp:set-trust'
|
||||
]);
|
||||
assert.ok(registered.every(item => typeof item.handler === 'function'));
|
||||
});
|
||||
Reference in New Issue
Block a user