Skip to content

Commit f87b930

Browse files
committed
Tests - Upgrade old CFG file having a 3.4 target version
1 parent 678a880 commit f87b930

18 files changed

+3250
-2067
lines changed

assets/src/legacy/map.js

-4
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ window.lizMap = function() {
163163
lizmap_plugin_version_str: "3.1.8",
164164
lizmap_plugin_version: 30108,
165165
lizmap_web_client_target_version: 30200,
166-
project_valid: null,
167166
qgis_desktop_version: 30000
168167
};
169168

@@ -176,9 +175,6 @@ window.lizMap = function() {
176175
if ('lizmap_web_client_target_version' in config['metadata']) {
177176
plugin_metadata['lizmap_web_client_target_version'] = config['metadata']['lizmap_web_client_target_version'];
178177
}
179-
if ('project_valid' in config['metadata']) {
180-
plugin_metadata['project_valid'] = config['metadata']['project_valid'];
181-
}
182178
if ('qgis_desktop_version' in config['metadata']) {
183179
plugin_metadata['qgis_desktop_version'] = config['metadata']['qgis_desktop_version'];
184180
}

assets/src/modules/config/Metadata.js

-10
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { BaseObjectConfig } from './BaseObject.js';
99

1010
const optionalProperties = {
1111
'lizmap_web_client_target_version': {type: 'number', default: 30200},
12-
'project_valid': {type: 'boolean', nullable: true, default: null},
1312
'qgis_desktop_version': {type: 'null', default: 30000}
1413
};
1514

@@ -26,7 +25,6 @@ export class MetadataConfig extends BaseObjectConfig {
2625
* @param {string} [cfg.lizmap_plugin_version] - the lizmap plugin version as number used to configure the project
2726
* @param {string} [cfg.lizmap_plugin_version_str] - the lizmap plugin version as string used to configure the project
2827
* @param {number} [cfg.lizmap_web_client_target_version] - the target lizmap web client version as integer
29-
* @param {boolean} [cfg.project_valid] - Is the project valid ?
3028
* @param {number} [cfg.qgis_desktop_version] - the QGIS Desktop version as integer used to build the project
3129
*/
3230
constructor(cfg = {}) {
@@ -89,14 +87,6 @@ export class MetadataConfig extends BaseObjectConfig {
8987
}
9088

9189

92-
/**
93-
* Is the project valid ?
94-
* @type {?boolean}
95-
*/
96-
get project_valid() {
97-
return this._project_valid;
98-
}
99-
10090
/**
10191
* The QGIS Desktop version as integer used to build the project
10292
* @type {number}

lizmap/modules/lizmap/lib/Project/ProjectConfig.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ private function parseDatavizTreeNode($node, $level, $debug)
676676
* Get the metadata written by Lizmap plugin
677677
* about the desktop version used.
678678
* qgis_desktop_version, lizmap_plugin_version,
679-
* lizmap_web_client_target_version, project_valid.
679+
* lizmap_web_client_target_version.
680680
*
681681
* @return null|object
682682
*/

tests/end2end/cypress/integration/requests-getprojectconfig-ghaction.js

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ describe('Request Lizmap GetProjectConfig', function () {
1313
expect(resp.body.metadata).to.have.property('lizmap_plugin_version')
1414
expect(resp.body.metadata).to.have.property('lizmap_plugin_version_str')
1515
expect(resp.body.metadata).to.have.property('lizmap_web_client_target_version')
16-
expect(resp.body.metadata).to.have.property('project_valid')
1716
expect(resp.body.metadata).to.have.property('qgis_desktop_version')
1817

1918
expect(resp.body).to.have.property('options')

tests/js-units/data/backgrounds-config.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -827,8 +827,7 @@
827827
"lizmap_web_client_target_version": 30700,
828828
"lizmap_web_client_target_status": "Dev",
829829
"instance_target_url": "https://demo.snap.lizmap.com/lizmap_3_7/",
830-
"instance_target_repository": "features",
831-
"project_valid": true
830+
"instance_target_repository": "features"
832831
},
833832
"options": {
834833
"projection": {

tests/js-units/data/cadastre-caen-config.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1183,8 +1183,7 @@
11831183
"lizmap_plugin_version": 31400,
11841184
"lizmap_web_client_target_version": 30500,
11851185
"lizmap_web_client_target_status": "Stable",
1186-
"instance_target_url": "https://demo.lizmap.com/lizmap_3_5/",
1187-
"project_valid": false
1186+
"instance_target_url": "https://demo.lizmap.com/lizmap_3_5/"
11881187
},
11891188
"options": {
11901189
"projection": {

tests/js-units/data/layer_order-config.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,7 @@
202202
"lizmap_web_client_target_version": 30700,
203203
"lizmap_web_client_target_status": "Dev",
204204
"instance_target_url": "http://localhost:8130/",
205-
"instance_target_repository": "intranet",
206-
"project_valid": true
205+
"instance_target_repository": "intranet"
207206
},
208207
"options": {
209208
"projection": {

tests/js-units/data/montpellier-config.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1213,8 +1213,7 @@
12131213
"metadata": {
12141214
"qgis_desktop_version": 31615,
12151215
"lizmap_plugin_version": "3.7.7",
1216-
"lizmap_web_client_target_version": 30500,
1217-
"project_valid": true
1216+
"lizmap_web_client_target_version": 30500
12181217
},
12191218
"options": {
12201219
"projection": {

tests/js-units/data/mutually-exclusive-config.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,7 @@
128128
"metadata": {
129129
"qgis_desktop_version": 32205,
130130
"lizmap_plugin_version": "master",
131-
"lizmap_web_client_target_version": 30500,
132-
"project_valid": true
131+
"lizmap_web_client_target_version": 30500
133132
},
134133
"options": {
135134
"projection": {

tests/js-units/node/config/metadata.test.js

+5-18
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ describe('MetadataConfig', function () {
88
expect(mt.lizmap_plugin_version_str).to.be.eq('3.1.8')
99
expect(mt.lizmap_plugin_version).to.be.eq(30108)
1010
expect(mt.lizmap_web_client_target_version).to.be.eq(30200)
11-
expect(mt.project_valid).to.be.eq(null)
1211
expect(mt.qgis_desktop_version).to.be.eq(30000)
1312
})
1413

@@ -23,21 +22,18 @@ describe('MetadataConfig', function () {
2322
expect(mt.lizmap_plugin_version_str).to.be.eq('3.8.1')
2423
expect(mt.lizmap_plugin_version).to.be.eq(30801)
2524
expect(mt.lizmap_web_client_target_version).to.be.eq(30503)
26-
expect(mt.project_valid).to.be.true
2725
expect(mt.qgis_desktop_version).to.be.eq(32200)
2826
})
2927

3028
it('events.qgs.cfg metadata', function () {
3129
const mt = new MetadataConfig({
3230
"qgis_desktop_version": 31615,
3331
"lizmap_plugin_version": "3.7.7",
34-
"lizmap_web_client_target_version": 30500,
35-
"project_valid": true
32+
"lizmap_web_client_target_version": 30500
3633
});
3734
expect(mt.lizmap_plugin_version_str).to.be.eq('3.7.7')
3835
expect(mt.lizmap_plugin_version).to.be.eq(30707)
3936
expect(mt.lizmap_web_client_target_version).to.be.eq(30500)
40-
expect(mt.project_valid).to.be.true
4137
expect(mt.qgis_desktop_version).to.be.eq(31615)
4238
})
4339

@@ -47,13 +43,11 @@ describe('MetadataConfig', function () {
4743
"lizmap_plugin_version_str": "3.9.1",
4844
"lizmap_plugin_version": 30901,
4945
"lizmap_web_client_target_version": 30500,
50-
"lizmap_web_client_target_status": "Stable",
51-
"project_valid": true
46+
"lizmap_web_client_target_status": "Stable"
5247
});
5348
expect(mt.lizmap_plugin_version_str).to.be.eq('3.9.1')
5449
expect(mt.lizmap_plugin_version).to.be.eq(30901)
5550
expect(mt.lizmap_web_client_target_version).to.be.eq(30500)
56-
expect(mt.project_valid).to.be.true
5751
expect(mt.qgis_desktop_version).to.be.eq(32211)
5852
})
5953

@@ -64,27 +58,23 @@ describe('MetadataConfig', function () {
6458
"lizmap_plugin_version": 31301,
6559
"lizmap_web_client_target_version": 30700,
6660
"lizmap_web_client_target_status": "Dev",
67-
"instance_target_url": "http://localhost:8130/",
68-
"project_valid": true
61+
"instance_target_url": "http://localhost:8130/"
6962
});
7063
expect(mt.lizmap_plugin_version_str).to.be.eq('3.13.1-alpha')
7164
expect(mt.lizmap_plugin_version).to.be.eq(31301)
7265
expect(mt.lizmap_web_client_target_version).to.be.eq(30700)
73-
expect(mt.project_valid).to.be.true
7466
expect(mt.qgis_desktop_version).to.be.eq(32216)
7567
})
7668

7769
it('stratup.qgs.cfg metadata', function () {
7870
const mt = new MetadataConfig({
7971
"qgis_desktop_version": 31615,
8072
"lizmap_plugin_version": "3.7.8-pre",
81-
"lizmap_web_client_target_version": 30500,
82-
"project_valid": true
73+
"lizmap_web_client_target_version": 30500
8374
});
8475
expect(mt.lizmap_plugin_version_str).to.be.eq('3.7.8-pre')
8576
expect(mt.lizmap_plugin_version).to.be.eq(30708)
8677
expect(mt.lizmap_web_client_target_version).to.be.eq(30500)
87-
expect(mt.project_valid).to.be.true
8878
expect(mt.qgis_desktop_version).to.be.eq(31615)
8979
})
9080

@@ -96,21 +86,18 @@ describe('MetadataConfig', function () {
9686
expect(mt.lizmap_plugin_version_str).to.be.eq('3.2.18')
9787
expect(mt.lizmap_plugin_version).to.be.eq(30218)
9888
expect(mt.lizmap_web_client_target_version).to.be.eq(30300)
99-
expect(mt.project_valid).to.be.null
10089
expect(mt.qgis_desktop_version).to.be.eq(30000)
10190
})
10291

10392
it('dnd_form.qgs.cfg metadata', function () {
10493
const mt = new MetadataConfig({
10594
"qgis_desktop_version": 32204,
10695
"lizmap_plugin_version": "master",
107-
"lizmap_web_client_target_version": 30500,
108-
"project_valid": true
96+
"lizmap_web_client_target_version": 30500
10997
});
11098
expect(mt.lizmap_plugin_version_str).to.be.eq('master')
11199
expect(mt.lizmap_plugin_version).to.be.eq(999999)
112100
expect(mt.lizmap_web_client_target_version).to.be.eq(30500)
113-
expect(mt.project_valid).to.be.true
114101
expect(mt.qgis_desktop_version).to.be.eq(32204)
115102
})
116103
})

0 commit comments

Comments
 (0)