Files
n8n-enterprise-unlocked/packages/nodes-base/nodes/Microsoft/AzureCosmosDb/test/item/query.test.ts
कारतोफ्फेलस्क्रिप्ट™ 91069f057e refactor: Overhaul nodes-testing setup - Part 2 (no-changelog) (#14873)
2025-04-24 17:37:26 +02:00

39 lines
832 B
TypeScript

import nock from 'nock';
import { testWorkflows, getWorkflowFilenames } from '@test/nodes/Helpers';
import { credentials } from '../credentials';
describe('Azure Cosmos DB - Query Items', () => {
const workflows = getWorkflowFilenames(__dirname).filter((filename) =>
filename.includes('query.workflow.json'),
);
beforeEach(() => {
const { baseUrl } = credentials.microsoftAzureCosmosDbSharedKeyApi;
nock(baseUrl)
.persist()
.defaultReplyHeaders({ 'Content-Type': 'application/json' })
.post('/colls/newId/docs', {
query: 'SELECT * FROM c WHERE c.id = @Param1',
parameters: [
{
name: '@Param1',
value: 'User1',
},
],
})
.reply(200, {
Documents: [
{
id: 'User1',
key1: 'value',
},
],
});
});
testWorkflows(workflows, credentials);
});