MCPcopy Create free account
hub / github.com/visgl/deck.gl / runLayerTestPostUpdateCheck

Function runLayerTestPostUpdateCheck

modules/test-utils/src/lifecycle-test.ts:386–410  ·  view source on GitHub ↗
(
  testCase: LayerTestCase<LayerT>,
  newLayer: LayerT,
  oldState: any,
  spyMap: Record<string, Spy>
)

Source from the content-addressed store, hash-verified

384}
385
386function runLayerTestPostUpdateCheck<LayerT extends Layer>(
387 testCase: LayerTestCase<LayerT>,
388 newLayer: LayerT,
389 oldState: any,
390 spyMap: Record<string, Spy>
391) {
392 // assert on updated layer
393 if (testCase.onAfterUpdate) {
394 // layer manager should handle match subLayer and tranfer state and props
395 // here we assume subLayer matches copy over the new props from a new subLayer
396 const subLayers = newLayer.isComposite
397 ? (newLayer as Layer as CompositeLayer).getSubLayers()
398 : [];
399 const subLayer = subLayers.length ? subLayers[0] : null;
400
401 testCase.onAfterUpdate({
402 testCase,
403 layer: newLayer,
404 oldState,
405 subLayers,
406 subLayer,
407 spies: spyMap
408 });
409 }
410}
411
412function runLayerTestUpdate<LayerT extends Layer>(
413 testCase: LayerTestCase<LayerT>,

Callers 2

testLayerFunction · 0.85
testLayerAsyncFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…