Initial import: open-design source for helix-mind.ai distribution
Some checks failed
ci / Validate workspace (push) Successful in 12m32s
landing-page-ci / Validate landing page (push) Successful in 9m41s
landing-page-deploy / Deploy landing page (push) Failing after 5m23s
github-metrics / Generate repository metrics SVG (push) Failing after 2m6s
refresh-contributors-wall / Refresh contributors wall cache bust (push) Failing after 12s
Some checks failed
ci / Validate workspace (push) Successful in 12m32s
landing-page-ci / Validate landing page (push) Successful in 9m41s
landing-page-deploy / Deploy landing page (push) Failing after 5m23s
github-metrics / Generate repository metrics SVG (push) Failing after 2m6s
refresh-contributors-wall / Refresh contributors wall cache bust (push) Failing after 12s
This repository contains the open-design daemon CLI source code, built and packaged at https://helix-mind.ai/cli/open-design/latest.tgz for use by the HelixMind /design slash command. Licenses: Apache-2.0 (root) + MIT (skills/*)
This commit is contained in:
31
apps/web/tests/utils/chatTime.test.ts
Normal file
31
apps/web/tests/utils/chatTime.test.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import type { ChatMessage } from '../../src/types';
|
||||
import { messageTime } from '../../src/utils/chatTime';
|
||||
|
||||
describe('messageTime', () => {
|
||||
it('uses assistant startedAt before persisted createdAt', () => {
|
||||
const message: ChatMessage = {
|
||||
id: 'assistant-1',
|
||||
role: 'assistant',
|
||||
content: 'Done',
|
||||
startedAt: 100,
|
||||
createdAt: 200,
|
||||
endedAt: 300,
|
||||
};
|
||||
|
||||
expect(messageTime(message)).toBe(100);
|
||||
});
|
||||
|
||||
it('keeps user createdAt as the primary timestamp', () => {
|
||||
const message: ChatMessage = {
|
||||
id: 'user-1',
|
||||
role: 'user',
|
||||
content: 'Build this',
|
||||
startedAt: 100,
|
||||
createdAt: 200,
|
||||
};
|
||||
|
||||
expect(messageTime(message)).toBe(200);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user