Skip to content

Commit 7868d8e

Browse files
Gonzalo-Avalos-Ribasmscottford
authored andcommitted
Add tests
1 parent 93bd5aa commit 7868d8e

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

packages/integration-sdk-testing/src/__tests__/executeStepWithDependencies.test.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,5 +221,41 @@ describe('executeStepWithDependencies', () => {
221221

222222
expect(stepTwoExecutionHandlerDidExecute).toBe(true);
223223
});
224+
225+
test('should work with normalizeGraphObjectKey', async () => {
226+
const e1 = getMockEntity();
227+
const e2 = getMockEntity();
228+
e2._key = 'KeY2';
229+
const r1 = createDirectRelationship({
230+
from: e1,
231+
_class: RelationshipClass.HAS,
232+
to: e2,
233+
});
234+
235+
const stepOne = getMockIntegrationStep({
236+
id: 'step-1',
237+
executionHandler: async ({ jobState }) => {
238+
await jobState.addEntity(e1);
239+
await jobState.addEntity(e2);
240+
if (jobState.hasKey('key2')) {
241+
await jobState.addRelationship(r1);
242+
}
243+
},
244+
});
245+
246+
await expect(
247+
executeStepWithDependencies({
248+
stepId: stepOne.id,
249+
invocationConfig: getMockInvocationConfig({
250+
integrationSteps: [stepOne],
251+
normalizeGraphObjectKey: (_key) => _key.toLowerCase(),
252+
}),
253+
instanceConfig: getMockInstanceConfig(),
254+
}),
255+
).resolves.toMatchObject({
256+
collectedEntities: [e1, e2],
257+
collectedRelationships: [r1],
258+
});
259+
});
224260
});
225261
});

0 commit comments

Comments
 (0)