!! Version 2 # Force the test runner to ensure the extension is loaded !! hooks maplink !! endhooks !! test !! wikitext !! html

0°0′0″N 0°0′0″E Foo & bar

!! end !! test - HTML sanitization !! wikitext !! html

<&

!! end !! test - counters and markers !! wikitext { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-number" } } { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-number" } } { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-letter" } } { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-letter" } } !! html

Foo

2

A

B

!! end !! test - autolabelling with coordinates !! wikitext !! html

10°0′0″N 20°0′0″E

!! end !! test - class parameter !! wikitext !! html

Empty class - do nothing Whitespace only class - do nothing Valid class

<maplink>: Attribute "class" has an invalid value
<maplink>: Attribute "class" has an invalid value
!! end !! test !! wikitext !! html

!! end !! test with a caption !! wikitext !! html
Foo is a bar

<mapframe latitude=10 longitude=20 zoom=13 width=640 height=480 align=left text="Foo is a bar" /> <mapframe latitude=10 longitude=20 zoom=13 width=640 height=480 align=center text="Foo is a <script>" />

Frameless gets cynically ignored here
Foo is a bar

<mapframe latitude=10 longitude=20 zoom=13 width=full height=480 text="

Muhaha

" />

!! end !! test Error messages !! wikitext >Derp goes here { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "title": "Foo bar", "marker-symbol": "museum", "marker-size": "medium", "marker-color": "fail" } } !! html

<maplink> problems:

  • Couldn't parse JSON: Syntax error
  • Attribute "longitude" has an invalid value

<mapframe> problems:

  • Attribute "mapstyle" has an invalid value
  • Attribute "align" has an invalid value
<mapframe>: Attribute "width" has an invalid value
<mapframe>: Attribute "width" has an invalid value
<mapframe>: Attribute "width" has an invalid value
<mapframe>: Attribute "width" has an invalid value

<mapframe> problems:

  • The JSON content is not valid GeoJSON+simplestyle
  • Attribute "mapstyle" has an invalid value
  • Attribute "align" has an invalid value
<mapframe>: Either both "latitude" and "longitude" parameters should be supplied or neither of them
<mapframe>: Either both "latitude" and "longitude" parameters should be supplied or neither of them
!! end !! test Error messages - localized !! options language=ru !! wikitext fail !! html
<maplink>: Ошибка JSON: Синтаксическая ошибка
!! end !! test CSS sanitization !! wikitext !! html

foo

!! end !! test - marker styles !! config wgKartographerUseMarkerStyle=true !! wikitext [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [1, 2] } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-letter", "marker-color": "#abcdef" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-number", "marker-color": "#DDEEFF" } } ] !! html

A

!! end !! test - marker styles disabled !! config wgKartographerUseMarkerStyle=false !! wikitext { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-letter", "marker-color": "#abcdef" } } !! html

A

!! end !! test Wikivoyage mode enabled !! config wgKartographerWikivoyageMode=true !! wikitext { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-letter", "marker-color": "#abcdef" } } !! html

0°0′0″N 0°0′0″E 0°0′0″N 0°0′0″E

!! end !! test Wikivoyage mode disabled !! config wgKartographerWikivoyageMode=false !! wikitext { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-122, 37] }, "properties": { "marker-symbol": "-letter", "marker-color": "#abcdef" } } !! html

0°0′0″N 0°0′0″E

!! end !! test show=... !! config wgKartographerWikivoyageMode=true !! wikitext !! html

0°0′0″N 0°0′0″E 0°0′0″N 0°0′0″E 0°0′0″N 0°0′0″E 0°0′0″N 0°0′0″E 0°0′0″N 0°0′0″E

<maplink>: Attribute "show" has an invalid value
!! end !! test ExternalData errors !! wikitext [ { "type": "ExternalData", "service": "fail", "ids": [ "Q1", "Q2" ] }, { "type": "ExternalData", "service": "lulzifier", "query": "test" } ] !! html
<maplink>: The JSON content is not valid GeoJSON+simplestyle
!! end