modified checks for Format.WFST should use not equal to undefined instead of truthy to deal properly with initial null values, r=ahocevar (closes #3436)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@12188 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
bartvde
2011-07-25 14:01:00 +00:00
parent 110acd3f84
commit 8abdd4f016
2 changed files with 15 additions and 7 deletions
+9 -1
View File
@@ -45,7 +45,7 @@
deleteFeature.state = OpenLayers.State.DELETE;
deleteFeature.fid = "fid.37";
t.plan(7);
t.plan(8);
var snippets = {
"GetFeature": {handle: "handle_g", maxFeatures: 1, outputFormat: 'json'},
"Transaction": {handle: "handle_t"},
@@ -74,6 +74,14 @@
var expected = readXML("UpdateModifiedNoGeometry");
var got = format.writers["wfs"]["Update"].apply(format, [{feature: updateFeature}]);
t.xml_eq(got, expected, "Update request for feature with no modified geometry but modified attributes created correctly");
// test for a feature that originally had a null geometry and a null value for the attribute
updateFeature.modified = {attributes: {foo: null, nul: "nul"}, geometry: null};
updateFeature.attributes.foo = "bar";
updateFeature.geometry = new OpenLayers.Geometry.Point(2,3);
var expected = readXML("UpdateModified");
var got = format.writers["wfs"]["Update"].apply(format, [{feature: updateFeature}]);
t.xml_eq(got, expected, "Update request for feature with modified geometry created correctly even if original geometry was null");
}
function test_writeNative(t) {