feat: secure Telegram access and connect AI Office

This commit is contained in:
pompy 2026-08-20 11:56:53 +08:00
parent e3ae772106
commit b0606159e0
30 changed files with 2045 additions and 302 deletions

View file

@ -96,7 +96,7 @@ const QQ_SOURCE_URL = new URL(
import.meta.url,
);
test('IM settings renders nine compact logo channel tabs without enable switches', async () => {
test('IM settings renders nine IM channels plus the AI Office connector', async () => {
const styles = await readFile(STYLES_URL, 'utf8');
const markup = renderToStaticMarkup(React.createElement(IMSettingsTab, {
feishuRpcCall: async () => ({ ok: true, value: {} }),
@ -108,6 +108,7 @@ test('IM settings renders nine compact logo channel tabs without enable switches
telegramRpcCall: async () => ({ ok: true, value: {} }),
discordRpcCall: async () => ({ ok: true, value: {} }),
whatsappRpcCall: async () => ({ ok: true, value: {} }),
officeRpcCall: async () => ({ ok: true, value: {} }),
}));
assert.match(markup, /IM机器人/);
@ -137,6 +138,7 @@ test('IM settings renders nine compact logo channel tabs without enable switches
assert.match(markup, />Telegram</);
assert.match(markup, />Discord</);
assert.match(markup, />WhatsApp</);
assert.match(markup, />AI Office</);
assert.match(markup, /dim-logoWeixin/);
assert.match(markup, /dim-logoFeishu/);
assert.match(markup, /dim-logoDingtalk/);
@ -146,8 +148,9 @@ test('IM settings renders nine compact logo channel tabs without enable switches
assert.match(markup, /dim-logoTelegram/);
assert.match(markup, /dim-logoDiscord/);
assert.match(markup, /dim-logoWhatsapp/);
assert.match(markup, /dim-logoOffice/);
assert.match(styles, /\.dim-logoFeishu svg \{ width: 28px; height: 28px; \}/);
assert.equal((markup.match(/role="tab"/g) ?? []).length, 9);
assert.equal((markup.match(/role="tab"/g) ?? []).length, 10);
assert.equal((markup.match(/aria-selected="true"/g) ?? []).length, 1);
assert.doesNotMatch(markup, /role="switch"|type="checkbox"/);
assert.doesNotMatch(markup, /dim-chevron|扫码绑定<\/small>|扫码接入<\/small>/);