- Refactored cross-team message formatting to use a canonical XML-like tag structure for improved clarity and consistency. - Introduced new attributes for cross-team messages, including 'from', 'depth', 'conversationId', and 'replyToConversationId'. - Enhanced TeamProvisioningService to manage pending cross-team reply expectations, ensuring proper message handling and relay. - Updated UI components to reflect changes in cross-team messaging, including stripping metadata from displayed messages. - Added tests to validate new cross-team message handling and ensure proper functionality across services.
26 lines
795 B
TypeScript
26 lines
795 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
|
|
import { parseCrossTeamPrefix, stripCrossTeamPrefix } from '@shared/constants/crossTeam';
|
|
|
|
describe('crossTeam protocol helpers', () => {
|
|
it('parses canonical cross-team prefix metadata', () => {
|
|
const parsed = parseCrossTeamPrefix(
|
|
'<cross-team from="dream-team.team-lead" depth="0" conversationId="conv-1" replyToConversationId="conv-0" />\nHello'
|
|
);
|
|
|
|
expect(parsed).toEqual({
|
|
from: 'dream-team.team-lead',
|
|
chainDepth: 0,
|
|
conversationId: 'conv-1',
|
|
replyToConversationId: 'conv-0',
|
|
});
|
|
});
|
|
|
|
it('strips canonical prefix from UI text', () => {
|
|
expect(
|
|
stripCrossTeamPrefix('<cross-team from="a.b" depth="0" conversationId="conv-1" />\nHello')
|
|
).toBe(
|
|
'Hello'
|
|
);
|
|
});
|
|
});
|