File tree Expand file tree Collapse file tree 3 files changed +37
-1
lines changed Expand file tree Collapse file tree 3 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -926,7 +926,7 @@ export class ComfyPage {
926926 async getNodeRefById ( id : NodeId ) {
927927 return new NodeReference ( id , this )
928928 }
929- async getNodes ( ) {
929+ async getNodes ( ) : Promise < LGraphNode [ ] > {
930930 return await this . page . evaluate ( ( ) => {
931931 return window [ 'app' ] . graph . nodes
932932 } )
Original file line number Diff line number Diff line change @@ -341,3 +341,30 @@ test.describe('Error dialog', () => {
341341 await expect ( errorDialog ) . toBeVisible ( )
342342 } )
343343} )
344+
345+ test . describe ( 'Signin dialog' , ( ) => {
346+ test ( 'Paste content to signin dialog should not paste node on canvas' , async ( {
347+ comfyPage
348+ } ) => {
349+ const nodeNum = ( await comfyPage . getNodes ( ) ) . length
350+ await comfyPage . clickEmptyLatentNode ( )
351+ await comfyPage . ctrlC ( )
352+
353+ const textBox = comfyPage . widgetTextBox
354+ await textBox . click ( )
355+ await textBox . fill ( 'test_password' )
356+ await textBox . press ( 'Control+a' )
357+ await textBox . press ( 'Control+c' )
358+
359+ await comfyPage . page . evaluate ( ( ) => {
360+ window [ 'app' ] . extensionManager . dialog . showSignInDialog ( )
361+ } )
362+
363+ const emailInput = comfyPage . page . locator ( '#comfy-org-sign-in-password' )
364+ await emailInput . waitFor ( { state : 'visible' } )
365+ await emailInput . press ( 'Control+v' )
366+ await expect ( emailInput ) . toHaveValue ( 'test_password' )
367+
368+ expect ( await comfyPage . getNodes ( ) ) . toHaveLength ( nodeNum )
369+ } )
370+ } )
Original file line number Diff line number Diff line change @@ -38,6 +38,15 @@ export const usePaste = () => {
3838 }
3939
4040 useEventListener ( document , 'paste' , async ( e ) => {
41+ const isTargetInGraph =
42+ e . target instanceof Element &&
43+ ( e . target . classList . contains ( 'litegraph' ) ||
44+ e . target . classList . contains ( 'graph-canvas-container' ) ||
45+ e . target . id === 'graph-canvas' )
46+
47+ // If the target is not in the graph, we don't want to handle the paste event
48+ if ( ! isTargetInGraph ) return
49+
4150 // ctrl+shift+v is used to paste nodes with connections
4251 // this is handled by litegraph
4352 if ( workspaceStore . shiftDown ) return
You can’t perform that action at this time.
0 commit comments