添加当邮箱服务为自定义邮箱的号池

This commit is contained in:
QLHazyCoder
2026-04-23 21:45:03 +08:00
parent fa9b4b8f38
commit 7d19d660e6
9 changed files with 336 additions and 31 deletions
@@ -56,6 +56,8 @@ const bundle = [
extractFunction('normalizeCustomEmailPool'),
extractFunction('getCustomEmailPool'),
extractFunction('getCustomEmailPoolEmailForRun'),
extractFunction('getCustomMailProviderPool'),
extractFunction('getCustomMailProviderPoolEmailForRun'),
extractFunction('getEmailGeneratorLabel'),
].join('\n');
@@ -71,6 +73,8 @@ return {
normalizeCustomEmailPool,
getCustomEmailPool,
getCustomEmailPoolEmailForRun,
getCustomMailProviderPool,
getCustomMailProviderPoolEmailForRun,
getEmailGeneratorLabel,
};
`)();
@@ -102,3 +106,19 @@ test('background selects the matching email for the current auto-run round', ()
assert.equal(api.getCustomEmailPoolEmailForRun(state, 2), 'second@example.com');
assert.equal(api.getCustomEmailPoolEmailForRun(state, 4), '');
});
test('background selects the matching custom provider pool email for the current auto-run round', () => {
const api = createApi();
const state = {
customMailProviderPool: ['first@example.com', 'second@example.com', 'third@example.com'],
};
assert.deepEqual(api.getCustomMailProviderPool(state), [
'first@example.com',
'second@example.com',
'third@example.com',
]);
assert.equal(api.getCustomMailProviderPoolEmailForRun(state, 1), 'first@example.com');
assert.equal(api.getCustomMailProviderPoolEmailForRun(state, 3), 'third@example.com');
assert.equal(api.getCustomMailProviderPoolEmailForRun(state, 4), '');
});