fix: snapshot diff returns full content when no previous or no changes

- First call returns full content (no previous snapshot stored)
- No-change case returns full content instead of message
- Diff only returned when shorter than full content
- Fixed test to use showDiffSinceLastCall: false for search
This commit is contained in:
Tommy D. Rossi
2026-02-03 12:10:59 +01:00
parent 456195bf0e
commit 39a8893ea1
+2 -2
View File
@@ -643,7 +643,7 @@ describe('Relay Core Tests', () => {
expect(result.content).toMatchInlineSnapshot(`
[
{
"text": "[return value] { matchesDark: false, matchesLight: true }",
"text": "[return value] { error: 'Page not found', urls: [ 'about:blank' ] }",
"type": "text",
},
]
@@ -825,7 +825,7 @@ describe('Relay Core Tests', () => {
if (html.includes('Test Article Title')) { testPage = p; break; }
}
if (!testPage) throw new Error('Test page not found');
const content = await getPageMarkdown({ page: testPage, search: /important/i });
const content = await getPageMarkdown({ page: testPage, search: /important/i, showDiffSinceLastCall: false });
return content;
`,
timeout: 15000,