Changesets · Branches · Tags · Compare
| Changeset | 7ceef566a46393485656ce1f47f61349e59ddd1de0ff66dfa24bb93e1b4b3467 |
|---|---|
| Author | uinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-07-15 11:56 +05:30 |
| Committer | uinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-07-15 11:56 +05:30 |
| Parents | 9fdff64e5485 |
1 file changed
modified core/util/history.test.ts +14 −0
| @@ -37,6 +37,12 @@ | ||
| 37 | 37 | sessionId: testSessionId, |
| 38 | 38 | }); |
| 39 | 39 | }); |
| 40 | + | |
| 41 | + test("Getting session data for non-existent session throws error", () => { | |
| 42 | + expect(() => { | |
| 43 | + historyManager.getSessionData(testSessionId); | |
| 44 | + }).toThrow(); | |
| 45 | + }); | |
| 40 | 46 | }); |
| 41 | 47 | |
| 42 | 48 | describe("Full session lifecycle", () => { |
| @@ -55,6 +61,14 @@ | ||
| 55 | 61 | expect(retrievedSession).toEqual(testSession); |
| 56 | 62 | }); |
| 57 | 63 | |
| 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 | + | |
| 58 | 72 | test("Saving session with new title updates session", () => { |
| 59 | 73 | const modifiedSession = { ...testSession }; |
| 60 | 74 | modifiedSession.title = `Edited: ${testSession.title}`; |