@@ -43,6 +43,33 @@ describe('Test the WMSUtils', () => {
4343 availableStyles : [ { name : 'generic' } ]
4444 } ) ;
4545 } ) ;
46+ it ( 'test getLayerOptions with empty or no Abstract' , ( ) => {
47+ expect ( getLayerOptions ( ) ) . toEqual ( { } ) ;
48+ const capabilities = {
49+ Style : { Name : 'generic' } ,
50+ LatLonBoundingBox : { $ : { minx : - 180 , miny : - 90 , maxx : 180 , maxy : 90 } }
51+ } ;
52+
53+ const capabilities2 = {
54+ Style : { Name : 'generic' } ,
55+ Abstract : '' ,
56+ LatLonBoundingBox : { $ : { minx : - 180 , miny : - 90 , maxx : 180 , maxy : 90 } }
57+ } ;
58+ // should not contain description if Abstract is undefined
59+ expect ( getLayerOptions ( capabilities ) )
60+ . toEqual ( {
61+ capabilities,
62+ boundingBox : { minx : - 180 , miny : - 90 , maxx : 180 , maxy : 90 } ,
63+ availableStyles : [ { name : 'generic' } ]
64+ } ) ;
65+ // should not contain description if Abstract is empty string
66+ expect ( getLayerOptions ( capabilities2 ) )
67+ . toEqual ( {
68+ capabilities : capabilities2 ,
69+ boundingBox : { minx : - 180 , miny : - 90 , maxx : 180 , maxy : 90 } ,
70+ availableStyles : [ { name : 'generic' } ]
71+ } ) ;
72+ } ) ;
4673 it ( 'test getTileGridFromLayerOptions' , ( ) => {
4774 const tileGrids = [
4875 {
0 commit comments