mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-22 15:54:09 +00:00
[perf] Fix Float32Array test assertions and link adapter
Fix the remaining Float32Array usage that was causing test failures: - Update test assertions to expect regular arrays instead of Float32Array - Convert link adapter Float32Array creation to regular arrays Resolves: AssertionError: expected [ 50, 60 ] to deeply equal Float32Array[ 50, 60 ]
This commit is contained in:
@@ -84,8 +84,8 @@ describe('LGraphNode', () => {
|
||||
}))
|
||||
}
|
||||
node.configure(configureData)
|
||||
expect(node.pos).toEqual(new Float32Array([50, 60]))
|
||||
expect(node.size).toEqual(new Float32Array([70, 80]))
|
||||
expect(node.pos).toEqual([50, 60])
|
||||
expect(node.size).toEqual([70, 80])
|
||||
})
|
||||
|
||||
test('should configure inputs correctly', () => {
|
||||
|
||||
@@ -449,7 +449,7 @@ export class LitegraphLinkAdapter {
|
||||
// Copy calculated center position back to litegraph object
|
||||
// This is needed for hit detection and menu interaction
|
||||
if (linkData.centerPos) {
|
||||
linkSegment._pos = linkSegment._pos || new Float32Array(2)
|
||||
linkSegment._pos = linkSegment._pos || [0, 0]
|
||||
linkSegment._pos[0] = linkData.centerPos.x
|
||||
linkSegment._pos[1] = linkData.centerPos.y
|
||||
|
||||
|
||||
@@ -84,8 +84,8 @@ describe('LGraphNode', () => {
|
||||
}))
|
||||
}
|
||||
node.configure(configureData)
|
||||
expect(node.pos).toEqual(new Float32Array([50, 60]))
|
||||
expect(node.size).toEqual(new Float32Array([70, 80]))
|
||||
expect(node.pos).toEqual([50, 60])
|
||||
expect(node.size).toEqual([70, 80])
|
||||
})
|
||||
|
||||
test('should configure inputs correctly', () => {
|
||||
|
||||
Reference in New Issue
Block a user