refactor: consolidate runtime helpers

This commit is contained in:
Eyejoker
2026-03-23 06:39:26 +09:00
parent c733217074
commit 898c77fcfc
15 changed files with 808 additions and 608 deletions

View File

@@ -1,6 +1,7 @@
import { describe, expect, it, vi } from 'vitest';
import {
composeDashboardContent,
editFormattedTrackedChannelMessage,
sendFormattedChannelMessage,
sendFormattedTrackedChannelMessage,
@@ -81,3 +82,21 @@ describe('index scheduler messaging helpers', () => {
expect(sendMessage).not.toHaveBeenCalled();
});
});
describe('composeDashboardContent', () => {
it('returns an empty string when all dashboard sections are disabled', () => {
expect(
composeDashboardContent([], new Date('2026-03-23T04:00:00+09:00')),
).toBe('');
});
it('keeps non-status sections when room status is hidden', () => {
const content = composeDashboardContent(
['**사용량**\nCodex OK'],
new Date('2026-03-23T04:00:00+09:00'),
);
expect(content).toContain('**사용량**');
expect(content).not.toContain('**📊 에이전트 상태**');
});
});