{
"description": "Test `#ask`/ NS_FILE option, `noimage` (`wgEnableUploads`, `wgFileExtensions`, `wgDefaultUserOptions`)",
"setup": [
{
"namespace": "SMW_NS_PROPERTY",
"page": "Has text",
"contents": "[[Has type::Text]]"
},
{
"namespace": "SMW_NS_PROPERTY",
"page": "Has file",
"contents": "[[Has type::Page]]"
},
{
"namespace": "SMW_NS_PROPERTY",
"page": "Has text",
"contents": "[[Has page::Page]]"
},
{
"namespace": "NS_FILE",
"page": "P0705.png",
"contents": {
"upload": {
"file" : "/../Fixtures/image-upload-480.png",
"text" : "[[Has file::{{FULLPAGENAME}}]] [[Has caption::123]] {{#subobject:Test|Has text=Foo}}"
}
}
},
{
"page": "Example/P0705/Q.1",
"contents": "{{#ask: [[Has file::+]] |?Has file |format=table |limit=1 }}"
},
{
"page": "Example/P0705/Q.2",
"contents": "{{#ask: [[Has file::+]] |?Has file#120px;thumb;{{#show: File:P0705.png |?Has caption |link=none}}[[Extra]] |format=table |limit=1 }}"
},
{
"page": "Example/P0705/Q.3",
"contents": "{{#ask: [[File:+]] }}"
},
{
"page": "Example/P0705/4",
"contents": "[[Has page::File:P0705.png]]"
},
{
"page": "Example/P0705/Q.4",
"contents": "{{#ask: [[Has page::[[File:+]]
]] |?Has page#noimage |format=table |limit=1 }}"
}
],
"tests": [
{
"type": "parser",
"about": "#0",
"subject": "Example/P0705/Q.1",
"assert-output": {
"to-contain": [
"href=\"/wiki/File:P0705.png\"",
"300px-P0705.png",
"width=\"300\" height=\"300\""
],
"not-contain": [
"P0705.png\" width=\"480\" height=\"480\""
]
}
},
{
"type": "parser",
"about": "#1 with options",
"subject": "Example/P0705/Q.2",
"assert-output": {
"to-contain": [
"300px-P0705.png",
"width=\"300\" height=\"300\"",
"120px-P0705.png\"",
"width=\"120\" height=\"120\"",
"123",
"Extra"
]
}
},
{
"type": "parser",
"about": "#2 (subobject is displayed as normal link and not with an image reference)",
"subject": "Example/P0705/Q.3",
"assert-output": {
"to-contain": [
"P0705.png#Test",
"Example/P0705/4