From 693a10422058f6f08f80c4eda2c21c2ba9cf6ebb Mon Sep 17 00:00:00 2001 From: Juha Alanen Date: Wed, 21 Aug 2019 13:55:38 +0300 Subject: [node] enable feature state tests --- platform/node/test/ignores.json | 15 --------------- platform/node/test/js/map.test.js | 3 +++ platform/node/test/suite_implementation.js | 6 ++++++ 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/platform/node/test/ignores.json b/platform/node/test/ignores.json index d32fb6b0c4..f053b2add1 100644 --- a/platform/node/test/ignores.json +++ b/platform/node/test/ignores.json @@ -20,15 +20,8 @@ "query-tests/geometry/multipolygon": "needs investigation", "query-tests/geometry/polygon": "needs investigation", "query-tests/world-wrapping/box": "skip - needs issue", - "query-tests/circle-radius/feature-state": "skip - port https://github.com/mapbox/mapbox-gl-js/pull/6263 - needs issue", - "query-tests/circle-stroke-width/feature-state": "skip - port https://github.com/mapbox/mapbox-gl-js/pull/6263 - needs issue", "query-tests/fill-extrusion-translate/multiple-layers": "https://github.com/mapbox/mapbox-gl-native/issues/12701", "query-tests/fill-translate/multiple-layers": "https://github.com/mapbox/mapbox-gl-native/issues/12701", - "query-tests/line-gap-width/feature-state": "skip - port https://github.com/mapbox/mapbox-gl-js/pull/6263 - needs issue", - "query-tests/line-offset/feature-state": "skip - port https://github.com/mapbox/mapbox-gl-js/pull/6263 - needs issue", - "query-tests/line-offset/pattern-feature-state": "skip - port https://github.com/mapbox/mapbox-gl-js/pull/6263 - needs issue", - "query-tests/line-width/feature-state": "skip - port https://github.com/mapbox/mapbox-gl-js/pull/6263 - needs issue", - "query-tests/feature-state/default": "skip - port https://github.com/mapbox/mapbox-gl-js/pull/6263 - needs issue", "query-tests/regressions/mapbox-gl-js#6555": "skip - no querySourceFeatures in mbgl-node; needs issue", "render-tests/background-color/transition": "https://github.com/mapbox/mapbox-gl-native/issues/10619", "render-tests/canvas/default": "skip - js specific", @@ -52,7 +45,6 @@ "render-tests/fill-extrusion-pattern/opacity": "https://github.com/mapbox/mapbox-gl-js/issues/3327", "render-tests/fill-extrusion-pattern/feature-expression": "https://github.com/mapbox/mapbox-gl-js/issues/3327", "render-tests/fill-extrusion-pattern/tile-buffer": "https://github.com/mapbox/mapbox-gl-js/issues/3327", - "render-tests/fill-pattern/update-feature-state": "skip - port https://github.com/mapbox/mapbox-gl-js/pull/6263 - needs issue", "render-tests/geojson/inline-linestring-fill": "current behavior is arbitrary", "render-tests/mixed-zoom/z10-z11": "https://github.com/mapbox/mapbox-gl-native/issues/10397", "render-tests/raster-masking/overlapping-zoom": "https://github.com/mapbox/mapbox-gl-native/issues/10195", @@ -73,19 +65,12 @@ "render-tests/symbol-cross-fade/chinese": "https://github.com/mapbox/mapbox-gl-native/issues/10619", "render-tests/video/default": "skip - https://github.com/mapbox/mapbox-gl-native/issues/601", "render-tests/background-color/colorSpace-hcl": "needs issue", - "render-tests/feature-state/composite-expression": "https://github.com/mapbox/mapbox-gl-native/issues/12613", - "render-tests/feature-state/data-expression": "https://github.com/mapbox/mapbox-gl-native/issues/12613", - "render-tests/feature-state/vector-source": "https://github.com/mapbox/mapbox-gl-native/issues/12613", "render-tests/text-variable-anchor/remember-last-placement": "skip - fails on gl-native, as symbol index is not functional at static map mode - needs issue", - "render-tests/remove-feature-state/composite-expression": "https://github.com/mapbox/mapbox-gl-native/issues/12413", - "render-tests/remove-feature-state/data-expression": "https://github.com/mapbox/mapbox-gl-native/issues/12413", - "render-tests/remove-feature-state/vector-source": "https://github.com/mapbox/mapbox-gl-native/issues/12413", "render-tests/regressions/mapbox-gl-js#8026": "skip - js specific", "render-tests/fill-extrusion-geometry/linestring": "https://github.com/mapbox/mapbox-gl-native/pull/14240", "render-tests/circle-sort-key/literal": "https://github.com/mapbox/mapbox-gl-native/issues/15008", "render-tests/fill-sort-key/literal": "https://github.com/mapbox/mapbox-gl-native/issues/15008", "render-tests/line-sort-key/literal": "https://github.com/mapbox/mapbox-gl-native/issues/15008", - "query-tests/remove-feature-state/default": "https://github.com/mapbox/mapbox-gl-native/issues/12413", "query-tests/fill-extrusion/base-in": "https://github.com/mapbox/mapbox-gl-native/issues/13139", "query-tests/fill-extrusion/box-in": "https://github.com/mapbox/mapbox-gl-native/issues/13139", "query-tests/fill-extrusion/side-in": "https://github.com/mapbox/mapbox-gl-native/issues/13139", diff --git a/platform/node/test/js/map.test.js b/platform/node/test/js/map.test.js index b21c1519e3..d085e32f4c 100644 --- a/platform/node/test/js/map.test.js +++ b/platform/node/test/js/map.test.js @@ -126,6 +126,9 @@ test('Map', function(t) { 'setAxonometric', 'setXSkew', 'setYSkew', + 'setFeatureState', + 'getFeatureState', + 'removeFeatureState', 'dumpDebugLogs', 'queryRenderedFeatures' ]); diff --git a/platform/node/test/suite_implementation.js b/platform/node/test/suite_implementation.js index f868af8ece..386bd41092 100644 --- a/platform/node/test/suite_implementation.js +++ b/platform/node/test/suite_implementation.js @@ -122,6 +122,12 @@ export default function (style, options, callback) { map.load(operation[1]); applyOperations(operations.slice(1), callback); + } else if (operation[0] ==='setFeatureState' || operation[0] ==='getFeatureState' || operation[0] ==='removeFeatureState') { + map.render(options, function () { + map[operation[0]].apply(map, operation.slice(1)); + applyOperations(operations.slice(1), callback); + }); + } else { // Ensure that the next `map.render(options)` does not overwrite this change. if (operation[0] === 'setCenter') { -- cgit v1.2.1