reuse status dashboard message and simplify settings actions
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
buildWebUsageRowsForSnapshot,
|
||||
formatStatusHeader,
|
||||
renderUsageTable,
|
||||
shouldPurgeDashboardChannelOnStart,
|
||||
summarizeWatcherTasks,
|
||||
} from './unified-dashboard.js';
|
||||
|
||||
@@ -61,6 +62,32 @@ describe('formatStatusHeader', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('shouldPurgeDashboardChannelOnStart', () => {
|
||||
it('keeps the existing status message when a stored message id exists', () => {
|
||||
expect(
|
||||
shouldPurgeDashboardChannelOnStart({
|
||||
purgeOnStart: true,
|
||||
storedMessageId: 'status-message-1',
|
||||
}),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it('purges only when explicitly requested and no stored message id exists', () => {
|
||||
expect(
|
||||
shouldPurgeDashboardChannelOnStart({
|
||||
purgeOnStart: true,
|
||||
storedMessageId: null,
|
||||
}),
|
||||
).toBe(true);
|
||||
expect(
|
||||
shouldPurgeDashboardChannelOnStart({
|
||||
purgeOnStart: false,
|
||||
storedMessageId: null,
|
||||
}),
|
||||
).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('renderUsageTable', () => {
|
||||
const claudeRow: UsageRow = {
|
||||
name: 'Claude pro',
|
||||
|
||||
Reference in New Issue
Block a user