summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/ModernTimeline/tests/System/JsonScript/query.json
blob: bca28efc0a50b591270c0a23c3a2b46cf531d15d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
{
	"description": "Modern Timeline - query result content",
	"setup": [
		{
			"page": "News date",
			"namespace": "SMW_NS_PROPERTY",
			"contents": "[[Has type::Date]]"
		},
		{
			"page": "End date",
			"namespace": "SMW_NS_PROPERTY",
			"contents": "[[Has type::Date]]"
		},
		{
			"page": "Description",
			"namespace": "SMW_NS_PROPERTY",
			"contents": "[[Has type::Text]]"
		},
		{
			"page": "First news event",
			"contents": "[[News date::August 1, 2019]] [[End date::August 3, 2019]] [[Description::first desc]]"
		},
		{
			"page": "Second news event",
			"contents": "[[News date::August 6, 2019]] [[Description::second desc]]"
		},
		{
			"page": "Page without date",
			"contents": "[[Description::No date here]]"
		},
		{
			"page": "Query page",
			"contents": "{{ #ask: [[Description::+]] | format=moderntimeline | ?News date | ?End date | ?Description }}"
		}
	],
	"tests": [
		{
			"about": "Only pages with dates are shown",
			"type": "parser",
			"subject": "Query page",
			"assert-output": {
				"include-head-items": true,
				"to-contain": [
					"First news event",
					"Second news event"
				],
				"not-contain": [
					"No date",
					"without date"
				]
			}
		},
		{
			"about": "Dates are included",
			"type": "parser",
			"subject": "Query page",
			"assert-output": {
				"include-head-items": true,
				"to-contain": [
					"month\":8",
					"day\":1",
					"day\":3",
					"day\":6"
				]
			}
		},
		{
			"about": "Extra printouts are included",
			"type": "parser",
			"subject": "Query page",
			"assert-output": {
				"include-head-items": true,
				"to-contain": [
					"first desc",
					"second desc"
				]
			}
		}
	],
	"settings": {
		"wgContLang": "en",
		"wgLang": "en",
		"smwgNamespacesWithSemanticLinks": {
			"NS_MAIN": true,
			"SMW_NS_PROPERTY": true
		}
	},
	"meta": {
		"version": "2",
		"is-incomplete": false,
		"debug": false
	}
}