mirror of https://github.com/buster-so/buster.git
add test for snapping over reasoning message 🐱
This commit is contained in:
parent
34c2165459
commit
a6bdd0eeb5
|
@ -503,4 +503,21 @@ describe('assetParamsToRoute', () => {
|
|||
})
|
||||
);
|
||||
});
|
||||
|
||||
test('reasoning messaged with chatid', () => {
|
||||
const test = {
|
||||
assetId: '06d9d8b7-eb96-59af-9a03-0436205b60a9',
|
||||
type: 'reasoning',
|
||||
chatId: 'chat-123'
|
||||
} as const;
|
||||
|
||||
const result = assetParamsToRoute(test);
|
||||
expect(result).toBe(
|
||||
createBusterRoute({
|
||||
route: BusterRoutes.APP_CHAT_ID_REASONING_ID,
|
||||
chatId: test.chatId,
|
||||
messageId: test.assetId
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -144,6 +144,24 @@ const createDashboardRoute = ({
|
|||
});
|
||||
};
|
||||
|
||||
const createReasoningRoute = ({
|
||||
messageId,
|
||||
chatId
|
||||
}: {
|
||||
messageId: string;
|
||||
chatId: string | undefined;
|
||||
}) => {
|
||||
if (!chatId) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return createBusterRoute({
|
||||
route: BusterRoutes.APP_CHAT_ID_REASONING_ID,
|
||||
chatId,
|
||||
messageId
|
||||
});
|
||||
};
|
||||
|
||||
export const assetParamsToRoute = ({
|
||||
chatId,
|
||||
assetId,
|
||||
|
@ -169,6 +187,13 @@ export const assetParamsToRoute = ({
|
|||
});
|
||||
}
|
||||
|
||||
if (type === 'reasoning') {
|
||||
return createReasoningRoute({
|
||||
messageId: assetId,
|
||||
chatId
|
||||
});
|
||||
}
|
||||
|
||||
console.warn('Asset params to route has not been implemented for this file type', type);
|
||||
return '';
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue