File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
packages/core-graph/src/private Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -91,8 +91,8 @@ scenario('Graph.subscribe()', bdd => {
9191 const graph = new Graph ( ( ) => ( ) => request => request ) ;
9292 const subscriber = fn ( ( ) => {
9393 // Should throw.
94- graph . act ( ( ) => {
95- // Intentionally left blank.
94+ graph . act ( ( { upsert } ) => {
95+ upsert ( { '@id' : '_:b2' } ) ;
9696 } ) ;
9797 } ) ;
9898
@@ -111,11 +111,14 @@ scenario('Graph.subscribe()', bdd => {
111111
112112 return undefined ;
113113 } )
114- . then ( 'should throw' , ( _ , error ) => {
115- expect ( ( ) => {
116- if ( error ) {
117- throw error ;
118- }
119- } ) . toThrow ( 'Another transaction is ongoing' ) ;
120- } ) ;
114+ . then ( 'getState() should return both nodes' , ( { graph } ) =>
115+ expect ( graph . getState ( ) ) . toEqual (
116+ new Map (
117+ Object . entries ( {
118+ '_:b1' : { '@id' : '_:b1' , name : 'John Doe' } ,
119+ '_:b2' : { '@id' : '_:b2' , name : 'Mary Doe' }
120+ } )
121+ )
122+ )
123+ ) ;
121124} ) ;
You can’t perform that action at this time.
0 commit comments