File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,28 @@ describe('BookmarkManager', () => {
63
63
)
64
64
} )
65
65
66
+ it ( 'should return not leak bookmarks from bookmarks supplier' , async ( ) => {
67
+ const extraBookmarks = [ 'neo4j:bmextra' , 'system:bmextra' , 'adb:bmextra' ]
68
+ const bookmarksSupplier = jest . fn ( )
69
+ bookmarkManager . mockReturnValueOnce ( Promise . resolve ( extraBookmarks ) ) . mockReturnValue ( Promise . resolve ( [ ] ) )
70
+ const manager = bookmarkManager ( {
71
+ initialBookmarks : [ ...neo4jBookmarks , ...systemBookmarks ] ,
72
+ bookmarksSupplier
73
+ } )
74
+
75
+ const bookmarksWithExtraBookmarks = await manager . getBookmarks ( )
76
+
77
+ expect ( bookmarksWithExtraBookmarks ) . toBeSortedEqual (
78
+ [ ...neo4jBookmarks , ...systemBookmarks , ...extraBookmarks ]
79
+ )
80
+
81
+ const internalBookmarks = await manager . getBookmarks ( )
82
+
83
+ expect ( bookmarksWithExtraBookmarks ) . toBeSortedEqual (
84
+ [ ...neo4jBookmarks , ...systemBookmarks ]
85
+ )
86
+ } )
87
+
66
88
it ( 'should return duplicate bookmarks if bookmarksSupplier returns already existing bm' , async ( ) => {
67
89
const extraBookmarks = [ 'neo4j:bmextra' , 'system:bmextra' , 'adb:bmextra' ]
68
90
const bookmarksSupplier = jest . fn ( async ( ) => await Promise . resolve ( [ ...extraBookmarks , ...systemBookmarks ] ) )
You can’t perform that action at this time.
0 commit comments