Skip to content

Commit

Permalink
Add spec to load tiles from a procedural voxel provider
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeshurun Hembd committed Feb 3, 2025
1 parent 4e392a0 commit 9ba36d1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/engine/Specs/Scene/VoxelPrimitiveSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,18 @@ describe(
expect(primitive.maximumValues).toBe(provider.maximumValues);
});

it("loads tiles from a minimal procedural provider", async function () {
const spyUpdate = jasmine.createSpy("listener");
const primitive = new VoxelPrimitive();
primitive.initialTilesLoaded.addEventListener(spyUpdate);
scene.primitives.add(primitive);
await pollToPromise(() => {
scene.renderForSpecs();
return primitive._traversal._initialTilesLoaded;
});
expect(spyUpdate.calls.count()).toEqual(1);
});

it("initial tiles loaded and all tiles loaded events are raised", async function () {
const spyUpdate1 = jasmine.createSpy("listener");
const spyUpdate2 = jasmine.createSpy("listener");
Expand Down

0 comments on commit 9ba36d1

Please sign in to comment.