mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 10:42:44 +00:00
test: replace hardcoded positions with computed NodeReference positions
- nodeSearchBox.spec.ts: Use NodeReference.getOutput() for CLIP output slot position - rightClickMenu.spec.ts: Use NodeReference.getTitlePosition() for node dragging - Add getTitlePosition() helper to NodeReference for drag operations Amp-Thread-ID: https://ampcode.com/threads/T-019c1367-6a59-7752-9329-17cbf152fc62 Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -312,6 +312,11 @@ export class NodeReference {
|
||||
async getFlags(): Promise<{ collapsed?: boolean; pinned?: boolean }> {
|
||||
return await this.getProperty('flags')
|
||||
}
|
||||
async getTitlePosition(): Promise<Position> {
|
||||
const nodePos = await this.getPosition()
|
||||
const nodeSize = await this.getSize()
|
||||
return { x: nodePos.x + nodeSize.width / 2, y: nodePos.y - 15 }
|
||||
}
|
||||
async isPinned() {
|
||||
return !!(await this.getFlags()).pinned
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user