feat(channels): add mattermost adapter and wiring
This commit is contained in:
@@ -438,6 +438,38 @@ describe('configSchema — audio talk mode', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('configSchema — mattermost', () => {
|
||||
const minimalConfig = {
|
||||
telegram: { bot_token: 'test', allowed_chat_ids: [1] },
|
||||
models: { default: { provider: 'anthropic', model: 'claude-3' } },
|
||||
};
|
||||
|
||||
it('accepts mattermost config and defaults optional fields', () => {
|
||||
const result = configSchema.parse({
|
||||
...minimalConfig,
|
||||
mattermost: {
|
||||
server_url: 'https://mattermost.example.com',
|
||||
bot_token: 'mm-token',
|
||||
},
|
||||
});
|
||||
|
||||
expect(result.mattermost).toBeDefined();
|
||||
if (!result.mattermost) {
|
||||
throw new Error('Expected mattermost config');
|
||||
}
|
||||
expect(result.mattermost.server_url).toBe('https://mattermost.example.com');
|
||||
expect(result.mattermost.allowed_channel_ids).toEqual([]);
|
||||
expect(result.mattermost.require_mention).toBe(true);
|
||||
expect(result.mattermost.mention_name).toBe('flynn');
|
||||
expect(result.mattermost.poll_interval_ms).toBe(3000);
|
||||
});
|
||||
|
||||
it('mattermost config is optional', () => {
|
||||
const result = configSchema.parse(minimalConfig);
|
||||
expect(result.mattermost).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe('configSchema — teams', () => {
|
||||
const minimalConfig = {
|
||||
telegram: { bot_token: 'test', allowed_chat_ids: [1] },
|
||||
|
||||
Reference in New Issue
Block a user