@@ -40,7 +40,7 @@ test.describe("Playwright Layer Context Menu Tests", () => {
4040 ( text ) => text . value
4141 ) ;
4242
43- expect ( copyLayer ) . toEqual ( "<layer- label=\"CBMT - INLINE\" checked=\"\">\n <map-extent units=\"CBMTILE\" hidden=\"\">\n <map-input name=\"zoomLevel\" type=\"zoom\" value=\"3\" min=\"0\" max=\"3\"></map-input>\n <map-input name=\"row\" type=\"location\" axis=\"row\" units=\"tilematrix\" min=\"14\" max=\"21\"></map-input>\n <map-input name=\"col\" type=\"location\" axis=\"column\" units=\"tilematrix\" min=\"14\" max=\"19\"></map-input>\n <map-link rel=\"tile\" tref=\"/data/cbmt/{zoomLevel}/c{col}_r{row}.png\"></map-link>\n </map-extent>\n </layer->" ) ;
43+ expect ( copyLayer ) . toEqual ( "<layer- label=\"CBMT - INLINE\" checked=\"\">\n <map-link rel=\"license\" title=\"Testing Inc.\"></map-link>\n <map- extent units=\"CBMTILE\" hidden=\"\">\n <map-input name=\"zoomLevel\" type=\"zoom\" value=\"3\" min=\"0\" max=\"3\"></map-input>\n <map-input name=\"row\" type=\"location\" axis=\"row\" units=\"tilematrix\" min=\"14\" max=\"21\"></map-input>\n <map-input name=\"col\" type=\"location\" axis=\"column\" units=\"tilematrix\" min=\"14\" max=\"19\"></map-input>\n <map-link rel=\"tile\" tref=\"http://localhost:30001 /data/cbmt/{zoomLevel}/c{col}_r{row}.png\"></map-link>\n </map-extent>\n </layer->" ) ;
4444 } ) ;
4545
4646 test ( "Map zooms in to layer 2" , async ( ) => {
@@ -60,7 +60,7 @@ test.describe("Playwright Layer Context Menu Tests", () => {
6060 ) ;
6161
6262 expect ( mapZoom ) . toEqual ( 11 ) ;
63- expect ( mapLocation ) . toEqual ( { max : { x : 43130 , y : 43130 } , min : { x : 42630 , y : 42630 } } ) ;
63+ expect ( mapLocation ) . toEqual ( { max : { x : 43380 , y : 43130 } , min : { x : 42380 , y : 42630 } } ) ;
6464 } ) ;
6565
6666 test ( "Map zooms out to layer 3" , async ( ) => {
@@ -84,7 +84,7 @@ test.describe("Playwright Layer Context Menu Tests", () => {
8484 ) ;
8585
8686 expect ( mapZoom ) . toEqual ( 11 ) ;
87- expect ( mapLocation ) . toEqual ( { max : { x : 43130 , y : 43557 } , min : { x : 42630 , y : 43057 } } ) ;
87+ expect ( mapLocation ) . toEqual ( { max : { x : 43380 , y : 43557 } , min : { x : 42380 , y : 43057 } } ) ;
8888 } ) ;
8989
9090 test ( "Map zooms out to layer 4" , async ( ) => {
@@ -108,6 +108,26 @@ test.describe("Playwright Layer Context Menu Tests", () => {
108108 ) ;
109109
110110 expect ( mapZoom ) . toEqual ( 5 ) ;
111- expect ( mapLocation ) . toEqual ( { max : { x : 8084 , y : 8084 } , min : { x : 7584 , y : 7584 } } ) ;
111+ expect ( mapLocation ) . toEqual ( { max : { x : 8334 , y : 8084 } , min : { x : 7334 , y : 7584 } } ) ;
112112 } ) ;
113- } ) ;
113+
114+ test ( "Copy layer with relative src attribute" , async ( ) => {
115+ await page . hover ( "div > div.leaflet-control-container > div.leaflet-top.leaflet-right > div" ) ;
116+ await page . click ( "div > div.leaflet-control-container > div.leaflet-top.leaflet-right > div > section > div.leaflet-control-layers-overlays > fieldset:nth-child(5) > div:nth-child(1) > label > span" ,
117+ { button : "right" } ) ;
118+
119+ await page . keyboard . press ( "l" ) ;
120+ await page . click ( "body > textarea#messageLayer" ) ;
121+ await page . keyboard . press ( "Control+a" ) ;
122+ await page . keyboard . press ( "Backspace" ) ;
123+ await page . keyboard . press ( "Control+v" ) ;
124+ const copyLayer = await page . $eval (
125+ "body > textarea#messageLayer" ,
126+ ( text ) => text . value
127+ ) ;
128+
129+ expect ( copyLayer ) . toEqual ( "<layer- src=\"http://localhost:30001/data/query/DouglasFir\" label=\"Natural Resources Canada - Douglas Fir (Genus Pseudotsuga) 250m resolution\"></layer->" ) ;
130+ } ) ;
131+
132+
133+ } ) ;
0 commit comments