Add a test to verify correct behavior of localized desc types

* Parsoid currently fails this and the failing test has been
  added to the known failure list. A follow-up patch will fix it.

Change-Id: Ic788340ec073b401e3e921339250a2678ea038da
This commit is contained in:
Subramanya Sastry 2023-10-09 12:20:08 -05:00
parent 9b9ef62a4c
commit be9aed5e13
2 changed files with 22 additions and 1 deletions

View file

@ -1 +1,5 @@
{}
{
"Non-default localized (French) description type": {
"wt2html": "<p data-parsoid='{\"dsr\":[0,56,0,0]}'><span typeof=\"mw:Extension/imagemap mw:Error\" about=\"#mwt2\" data-parsoid='{\"dsr\":[0,56,10,11]}' data-mw='{\"name\":\"imagemap\",\"attrs\":{},\"body\":{\"extsrc\":\"\\nImage:Foobar.jpg\\ndesc haut-gauche\\n\"},\"errors\":[{\"key\":\"imagemap_invalid_desc\",\"params\":[\"top-right, bottom-right, bottom-left, top-left, none\"]}]}' data-mw-i18n='{\"/\":{\"lang\":\"x-user\",\"key\":\"imagemap_invalid_desc\",\"params\":[\"top-right, bottom-right, bottom-left, top-left, none\"]}}'>imagemap_invalid_desc</span></p>"
}
}

View file

@ -174,6 +174,23 @@ desc top-left
<figure class="mw-default-size noresize mw-ext-imagemap-desc-top-left" typeof="mw:File mw:Extension/imagemap" about="#mwt2" data-mw='{"name":"imagemap","attrs":{},"body":{"extsrc":"\nImage:Foobar.jpg\ndesc top-left\n"}}'><span><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></span><figcaption></figcaption></figure>
!! end
!! test
Non-default localized (French) description type
!! options
language=fr
!! config
wgParserEnableLegacyMediaDOM=false
!! wikitext
<imagemap>
Image:Foobar.jpg
desc haut-gauche
</imagemap>
!! html/php
<figure class="mw-default-size noresize mw-ext-imagemap-desc-top-left" typeof="mw:File"><span><img src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" class="mw-file-element" resource="/wiki/Fichier:Foobar.jpg" /></span><figcaption></figcaption></figure>
!! html/parsoid
<figure class="mw-default-size noresize mw-ext-imagemap-desc-top-left" typeof="mw:File mw:Extension/imagemap" about="#mwt2" data-mw='{"name":"imagemap","attrs":{},"body":{"extsrc":"\nImage:Foobar.jpg\ndesc haut-gauche\n"}}'><span><img resource="./Fichier:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941" class="mw-file-element"/></span><figcaption></figcaption></figure>
!! end
!! test
None description type
!! config