fix: 修正网易邮箱共享脚本的邮箱品牌日志
This commit is contained in:
@@ -101,6 +101,23 @@ return { findMailItems };
|
||||
assert.equal(rows.length, 1);
|
||||
});
|
||||
|
||||
test('getNetEaseMailLabel returns the active NetEase mailbox brand', () => {
|
||||
const bundle = [
|
||||
extractFunction('getNetEaseMailLabel'),
|
||||
].join('\n');
|
||||
|
||||
const api = new Function(`
|
||||
${bundle}
|
||||
return { getNetEaseMailLabel };
|
||||
`)();
|
||||
|
||||
assert.equal(api.getNetEaseMailLabel('mail.126.com'), '126 邮箱');
|
||||
assert.equal(api.getNetEaseMailLabel('app.mail.126.com'), '126 邮箱');
|
||||
assert.equal(api.getNetEaseMailLabel('webmail.vip.163.com'), '163 VIP 邮箱');
|
||||
assert.equal(api.getNetEaseMailLabel('mail.163.com'), '163 邮箱');
|
||||
assert.equal(api.getNetEaseMailLabel('example.com'), '163 邮箱');
|
||||
});
|
||||
|
||||
test('getMailTimestamp parses visible hh:mm text even when no title attribute exists', () => {
|
||||
const bundle = [
|
||||
extractFunction('normalizeText'),
|
||||
@@ -358,10 +375,12 @@ test('handlePollEmail ignores same-minute old snapshot mail before fallback', as
|
||||
const bundle = [
|
||||
extractFunction('normalizeText'),
|
||||
extractFunction('normalizeMinuteTimestamp'),
|
||||
extractFunction('getNetEaseMailLabel'),
|
||||
extractFunction('handlePollEmail'),
|
||||
].join('\n');
|
||||
|
||||
const api = new Function(`
|
||||
const location = { hostname: 'mail.126.com' };
|
||||
let currentItems = [{ id: 'old-mail' }];
|
||||
const seenCodes = new Set();
|
||||
|
||||
@@ -419,7 +438,7 @@ return { handlePollEmail };
|
||||
intervalMs: 1,
|
||||
filterAfterTimestamp: new Date(2026, 3, 22, 22, 22, 40, 0).getTime(),
|
||||
}),
|
||||
/未在 163 邮箱中找到新的匹配邮件/
|
||||
/未在 126 邮箱中找到新的匹配邮件/
|
||||
);
|
||||
});
|
||||
|
||||
@@ -427,6 +446,7 @@ test('handlePollEmail accepts a new same-minute mail that appears after the snap
|
||||
const bundle = [
|
||||
extractFunction('normalizeText'),
|
||||
extractFunction('normalizeMinuteTimestamp'),
|
||||
extractFunction('getNetEaseMailLabel'),
|
||||
extractFunction('handlePollEmail'),
|
||||
].join('\n');
|
||||
|
||||
@@ -519,6 +539,7 @@ test('handlePollEmail falls back to row text when the subject node is missing',
|
||||
const bundle = [
|
||||
extractFunction('normalizeText'),
|
||||
extractFunction('normalizeMinuteTimestamp'),
|
||||
extractFunction('getNetEaseMailLabel'),
|
||||
extractFunction('handlePollEmail'),
|
||||
].join('\n');
|
||||
|
||||
@@ -598,6 +619,7 @@ test('handlePollEmail opens matching mail body when preview has no code', async
|
||||
const bundle = [
|
||||
extractFunction('normalizeText'),
|
||||
extractFunction('normalizeMinuteTimestamp'),
|
||||
extractFunction('getNetEaseMailLabel'),
|
||||
extractFunction('handlePollEmail'),
|
||||
].join('\n');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user