mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-03-27 04:33:07 +00:00
fix: update saveNode test mocks for docs preservation pattern
Tests now account for the SELECT query that reads existing docs before INSERT OR REPLACE, and the 3 extra params (npm_readme, ai_documentation_summary, ai_summary_generated_at). Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -119,8 +119,13 @@ class MockPreparedStatement implements PreparedStatement {
|
||||
});
|
||||
}
|
||||
|
||||
// saveNode - SELECT existing doc fields before upsert
|
||||
if (this.sql.includes('SELECT npm_readme, ai_documentation_summary, ai_summary_generated_at FROM nodes')) {
|
||||
this.get = vi.fn(() => undefined); // No existing row by default
|
||||
}
|
||||
|
||||
// saveNode - INSERT OR REPLACE
|
||||
if (this.sql.includes('INSERT INTO nodes')) {
|
||||
if (this.sql.includes('INSERT OR REPLACE INTO nodes')) {
|
||||
this.run = vi.fn((...params: any[]): RunResult => {
|
||||
const nodes = this.mockData.get('community_nodes') || [];
|
||||
const nodeType = params[0];
|
||||
|
||||
Reference in New Issue
Block a user