Skip to content

Commit

Permalink
Merge 594139c into 3edc639
Browse files Browse the repository at this point in the history
  • Loading branch information
georgios-uber committed Jun 6, 2019
2 parents 3edc639 + 594139c commit 0992efd
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
Expand Up @@ -132,6 +132,7 @@ export default class ScenegraphLayer extends Layer {
}

finalizeState() {
super.finalizeState();
this._deleteScenegraph();
}

Expand Down
1 change: 1 addition & 0 deletions test/modules/layers/index.js
Expand Up @@ -26,6 +26,7 @@ import './polygon-layer.spec';
import './geojson.spec';
import './geojson-layer.spec';
import './simple-mesh-layer.spec';
import './scenegraph-layer.spec';
import './path-layer/path-layer-vertex.spec';
import './icon-manager.spec';
import './text-layer/font-atlas-utils.spec';
Expand Down
49 changes: 49 additions & 0 deletions test/modules/layers/scenegraph-layer.spec.js
@@ -0,0 +1,49 @@
// Copyright (c) 2015 - 2017 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

import test from 'tape-catch';
import {testLayer, generateLayerTests} from '@deck.gl/test-utils';

import {ScenegraphLayer} from '@deck.gl/mesh-layers';

import * as FIXTURES from 'deck.gl-test/data';

test('ScenegraphLayer#tests', t => {
const testCases = generateLayerTests({
Layer: ScenegraphLayer,
sampleProps: {
data: FIXTURES.points,
getPosition: d => d.COORDINATES,
scenegraph: ''
},
assert: t.ok,
onBeforeUpdate: ({testCase}) => t.comment(testCase.title),
onAfterUpdate: ({layer, subLayers}) => {
// if (layer.props.mesh) {
// t.ok(layer.getModels().length > 0, 'Layer should have models');
// }
},
runDefaultAsserts: false
});

testLayer({Layer: ScenegraphLayer, testCases, onError: t.notOk});

t.end();
});

0 comments on commit 0992efd

Please sign in to comment.