@@ -190,6 +190,26 @@ describe('spatial-types', () => {
190
190
testSendingAndReceivingOfPoints ( done , new Point ( CARTESIAN_3D_CRS_CODE . toNumber ( ) , 12.87 , 13.89 , 14.901 ) ) ;
191
191
} ) ;
192
192
193
+ it ( 'should convert points to string' , ( ) => {
194
+ const point1 = new Point ( CARTESIAN_3D_CRS_CODE , 19.24 , 100.29 , 20.22222 ) ;
195
+ expect ( point1 . toString ( ) ) . toEqual ( 'Point{srid=9157, x=19.24, y=100.29, z=20.22222}' ) ;
196
+
197
+ const point2 = new Point ( WGS_84_2D_CRS_CODE , 1.00005 , 2.00006 ) ;
198
+ expect ( point2 . toString ( ) ) . toEqual ( 'Point{srid=4326, x=1.00005, y=2.00006}' ) ;
199
+
200
+ const point3 = new Point ( WGS_84_3D_CRS_CODE , 1.111 , 2.222 , 0.0 ) ;
201
+ expect ( point3 . toString ( ) ) . toEqual ( 'Point{srid=4979, x=1.111, y=2.222, z=0.0}' ) ;
202
+
203
+ const point4 = new Point ( CARTESIAN_2D_CRS_CODE , 78.15 , 92.2 , null ) ;
204
+ expect ( point4 . toString ( ) ) . toEqual ( 'Point{srid=7203, x=78.15, y=92.2}' ) ;
205
+
206
+ const point5 = new Point ( WGS_84_2D_CRS_CODE , 123.9 , 64.5 , undefined ) ;
207
+ expect ( point5 . toString ( ) ) . toEqual ( 'Point{srid=4326, x=123.9, y=64.5}' ) ;
208
+
209
+ const point6 = new Point ( CARTESIAN_2D_CRS_CODE , 23.9378123 , 67.3891 , Number . NaN ) ;
210
+ expect ( point6 . toString ( ) ) . toEqual ( 'Point{srid=7203, x=23.9378123, y=67.3891}' ) ;
211
+ } ) ;
212
+
193
213
function testReceivingOfPoints ( done , query , pointChecker ) {
194
214
if ( neo4jDoesNotSupportPoints ( done ) ) {
195
215
return ;
0 commit comments