@@ -231,6 +231,46 @@ describe('Field Validations', () => {
231231 const result = point ( val , pointOptions )
232232 expect ( result ) . not . toBe ( true )
233233 } )
234+ it ( 'should validate longitude within bounds' , ( ) => {
235+ const val : PointFieldValue = [ '180' , '0' ]
236+ const result = point ( val , pointOptions )
237+ expect ( result ) . toBe ( true )
238+ } )
239+ it ( 'should validate longitude at lower bound' , ( ) => {
240+ const val : PointFieldValue = [ '-180' , '0' ]
241+ const result = point ( val , pointOptions )
242+ expect ( result ) . toBe ( true )
243+ } )
244+ it ( 'should prevent longitude below lower bound' , ( ) => {
245+ const val : PointFieldValue = [ '-181' , '0' ]
246+ const result = point ( val , pointOptions )
247+ expect ( result ) . toBe ( 'validation:longitudeOutOfBounds' )
248+ } )
249+ it ( 'should prevent longitude above upper bound' , ( ) => {
250+ const val : PointFieldValue = [ '181' , '0' ]
251+ const result = point ( val , pointOptions )
252+ expect ( result ) . toBe ( 'validation:longitudeOutOfBounds' )
253+ } )
254+ it ( 'should validate latitude within bounds' , ( ) => {
255+ const val : PointFieldValue = [ '0' , '90' ]
256+ const result = point ( val , pointOptions )
257+ expect ( result ) . toBe ( true )
258+ } )
259+ it ( 'should validate latitude at lower bound' , ( ) => {
260+ const val : PointFieldValue = [ '0' , '-90' ]
261+ const result = point ( val , pointOptions )
262+ expect ( result ) . toBe ( true )
263+ } )
264+ it ( 'should prevent latitude below lower bound' , ( ) => {
265+ const val : PointFieldValue = [ '0' , '-91' ]
266+ const result = point ( val , pointOptions )
267+ expect ( result ) . toBe ( 'validation:latitudeOutOfBounds' )
268+ } )
269+ it ( 'should prevent latitude above upper bound' , ( ) => {
270+ const val : PointFieldValue = [ '0' , '91' ]
271+ const result = point ( val , pointOptions )
272+ expect ( result ) . toBe ( 'validation:latitudeOutOfBounds' )
273+ } )
234274 } )
235275
236276 describe ( 'relationship' , ( ) => {
0 commit comments