File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -38,9 +38,11 @@ class ComfyNodeSearchBox {
38
38
}
39
39
40
40
class ComfyMenu {
41
+ public readonly sideToolBar : Locator
41
42
public readonly themeToggleButton : Locator
42
43
43
44
constructor ( public readonly page : Page ) {
45
+ this . sideToolBar = page . locator ( '.side-tool-bar-container' )
44
46
this . themeToggleButton = page . locator ( '.comfy-vue-theme-toggle' )
45
47
}
46
48
Original file line number Diff line number Diff line change @@ -42,4 +42,29 @@ test.describe('Menu', () => {
42
42
43
43
expect ( await comfyPage . menu . getThemeId ( ) ) . toBe ( 'dark' )
44
44
} )
45
+
46
+ test ( 'Can register sidebar tab' , async ( { comfyPage } ) => {
47
+ const initialChildrenCount = await comfyPage . menu . sideToolBar . evaluate (
48
+ ( el ) => el . children . length
49
+ )
50
+
51
+ await comfyPage . page . evaluate ( async ( ) => {
52
+ window [ 'app' ] . extensionManager . registerSidebarTab ( {
53
+ id : 'search' ,
54
+ icon : 'pi pi-search' ,
55
+ title : 'search' ,
56
+ tooltip : 'search' ,
57
+ type : 'custom' ,
58
+ render : ( el ) => {
59
+ el . innerHTML = '<div>Custom search tab</div>'
60
+ }
61
+ } )
62
+ } )
63
+ await comfyPage . nextFrame ( )
64
+
65
+ const newChildrenCount = await comfyPage . menu . sideToolBar . evaluate (
66
+ ( el ) => el . children . length
67
+ )
68
+ expect ( newChildrenCount ) . toBe ( initialChildrenCount + 1 )
69
+ } )
45
70
} )
You can’t perform that action at this time.
0 commit comments