File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -231,10 +231,21 @@ class Notification {
231
231
* @param {Object } notification - Object with notification data
232
232
*/
233
233
constructor ( notification ) {
234
- this . code = notifications . code ;
235
- this . title = notifications . title ;
236
- this . description = notifications . desciption ;
237
- this . position [ offset , line , column ] = notifications . position ;
234
+ this . code = notification . code ;
235
+ this . title = notification . title ;
236
+ this . description = notification . desciption ;
237
+ this . position = this . _constructPosition ( notification . position ) ;
238
+ }
239
+
240
+ _constructPosition ( pos ) {
241
+ if ( ! pos ) {
242
+ return { } ;
243
+ }
244
+ return {
245
+ offset : pos . offset . toInt ( ) ,
246
+ line : pos . line . toInt ( ) ,
247
+ column : pos . column . toInt ( )
248
+ }
238
249
}
239
250
}
240
251
Original file line number Diff line number Diff line change @@ -198,7 +198,9 @@ describe('session', function() {
198
198
result . then ( function ( records ) {
199
199
var sum = result . summarize ( ) ;
200
200
expect ( sum . notifications . length ) . toBeGreaterThan ( 0 ) ;
201
- expect ( sum . notifications [ 0 ] . position . offset ) . toBeGreaterThan ( 0 ) ;
201
+ expect ( sum . notifications [ 0 ] . code ) . toBe ( "Neo.ClientNotification.Statement.CartesianProduct" ) ;
202
+ expect ( sum . notifications [ 0 ] . title ) . toBe ( "This query builds a cartesian product between disconnected patterns." ) ;
203
+ expect ( sum . notifications [ 0 ] . position . column ) . toBeGreaterThan ( 0 ) ;
202
204
driver . close ( ) ;
203
205
done ( ) ;
204
206
} ) ;
You can’t perform that action at this time.
0 commit comments