Elffuss BraidHub

kikocis/continue public

add tests
Changeset7ceef566a46393485656ce1f47f61349e59ddd1de0ff66dfa24bb93e1b4b3467
Authoruinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-07-15 11:56 +05:30
Committeruinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-07-15 11:56 +05:30
Parents9fdff64e5485

Browse the files at this changeset

1 file changed

modified core/util/history.test.ts +14 −0
@@ -37,6 +37,12 @@
3737 sessionId: testSessionId,
3838 });
3939 });
40+
41+ test("Getting session data for non-existent session throws error", () => {
42+ expect(() => {
43+ historyManager.getSessionData(testSessionId);
44+ }).toThrow();
45+ });
4046 });
4147
4248 describe("Full session lifecycle", () => {
@@ -55,6 +61,14 @@
5561 expect(retrievedSession).toEqual(testSession);
5662 });
5763
64+ test("Getting session data returns formatted JSON string", () => {
65+ const sessionData = historyManager.getSessionData(testSession.sessionId);
66+ const parsed = JSON.parse(sessionData);
67+ expect(parsed.sessionId).toBe(testSession.sessionId);
68+ expect(parsed.title).toBe(testSession.title);
69+ expect(parsed.workspaceDirectory).toBe(testSession.workspaceDirectory);
70+ });
71+
5872 test("Saving session with new title updates session", () => {
5973 const modifiedSession = { ...testSession };
6074 modifiedSession.title = `Edited: ${testSession.title}`;