mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-03-26 20:23:08 +00:00
fix: update test assertions for ON CONFLICT saveNode SQL
Tests expected old INSERT OR REPLACE SQL, updated to match new INSERT INTO ... ON CONFLICT(node_type) DO UPDATE SET pattern. Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -120,7 +120,7 @@ class MockPreparedStatement implements PreparedStatement {
|
||||
}
|
||||
|
||||
// saveNode - INSERT OR REPLACE
|
||||
if (this.sql.includes('INSERT OR REPLACE INTO nodes')) {
|
||||
if (this.sql.includes('INSERT INTO nodes')) {
|
||||
this.run = vi.fn((...params: any[]): RunResult => {
|
||||
const nodes = this.mockData.get('community_nodes') || [];
|
||||
const nodeType = params[0];
|
||||
|
||||
@@ -91,7 +91,7 @@ describe('NodeRepository - Core Functionality', () => {
|
||||
repository.saveNode(parsedNode);
|
||||
|
||||
// Verify prepare was called with correct SQL
|
||||
expect(mockAdapter.prepare).toHaveBeenCalledWith(expect.stringContaining('INSERT OR REPLACE INTO nodes'));
|
||||
expect(mockAdapter.prepare).toHaveBeenCalledWith(expect.stringContaining('INSERT INTO nodes'));
|
||||
|
||||
// Get the prepared statement and verify run was called
|
||||
const stmt = mockAdapter._getStatement(mockAdapter.prepare.mock.lastCall?.[0] || '');
|
||||
|
||||
@@ -56,7 +56,7 @@ describe('NodeRepository - Outputs Handling', () => {
|
||||
repository.saveNode(node);
|
||||
|
||||
expect(mockDb.prepare).toHaveBeenCalledWith(`
|
||||
INSERT OR REPLACE INTO nodes (
|
||||
INSERT INTO nodes (
|
||||
node_type, package_name, display_name, description,
|
||||
category, development_style, is_ai_tool, is_trigger,
|
||||
is_webhook, is_versioned, is_tool_variant, tool_variant_of,
|
||||
|
||||
Reference in New Issue
Block a user