mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-09-01 03:27:01 +00:00
* feat: add Mongo-backed admin insights * feat: gate insights with environment variable * fix: tighten insights access and activity metrics * fix: preserve insights date selections * perf: parallelize insights search aggregation * test: wait for MCP conflict recovery * test: satisfy strict MCP recovery typing * fix: disable insights pagination while loading * fix: localize insights range shortcuts * fix: bound insights search input
12 lines
431 B
TypeScript
12 lines
431 B
TypeScript
import { getRollingDateRange } from './dateRange';
|
|
|
|
describe('Insights date ranges', () => {
|
|
it('builds shortcut bounds from the same rolling duration as the query', () => {
|
|
const endDate = new Date(2026, 7, 31, 15, 30);
|
|
|
|
const range = getRollingDateRange(endDate, 30);
|
|
|
|
expect(range.endDate.getTime() - range.startDate.getTime()).toBe(30 * 24 * 60 * 60 * 1000);
|
|
expect(range.endDate).toEqual(endDate);
|
|
});
|
|
});
|