fix(editor): Fix flaky composable test (no-changelog) (#16927)

This commit is contained in:
Milorad FIlipović
2025-07-02 17:21:49 +02:00
committed by GitHub
parent 31bd88fde9
commit 5c5c06aa58

View File

@@ -487,8 +487,10 @@ describe('useCanvasOperations', () => {
const { resolveNodePosition } = useCanvasOperations();
const position = resolveNodePosition({ ...node, position: undefined }, nodeTypeDescription);
// No custom offset applied
expect(position).toEqual([60, 320]);
// No custom offset applied, allowing for some wiggle room when tests are run on different environments
expect(position[0]).toBeGreaterThanOrEqual(40);
expect(position[0]).toBeLessThanOrEqual(80);
expect(position[1]).toBe(320);
});
it('should handle missing connection type gracefully', () => {
@@ -521,8 +523,10 @@ describe('useCanvasOperations', () => {
const { resolveNodePosition } = useCanvasOperations();
const position = resolveNodePosition({ ...node, position: undefined }, nodeTypeDescription);
// No custom offset applied
expect(position).toEqual([60, 320]);
// No custom offset applied, allowing for some wiggle room when tests are run on different environments
expect(position[0]).toBeGreaterThanOrEqual(40);
expect(position[0]).toBeLessThanOrEqual(80);
expect(position[1]).toBe(320);
});
});