Skip to content

Commit 9c63bc6

Browse files
committed
Update clipping polygon specs
1 parent 86c33bb commit 9c63bc6

5 files changed

Lines changed: 27 additions & 551 deletions

File tree

packages/engine/Specs/Scene/Cesium3DTilesetSpec.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4461,7 +4461,7 @@ describe(
44614461
polygon = new ClippingPolygon({ positions });
44624462
});
44634463

4464-
it("destroys attached ClippingPolygonCollections and ClippingPolygonCollections that have been detached", async function () {
4464+
it("detaches ClippingPolygonCollections without destroying them", async function () {
44654465
const tileset = await Cesium3DTilesTester.loadTileset(
44664466
scene,
44674467
tilesetUrl,
@@ -4472,15 +4472,20 @@ describe(
44724472
expect(collectionA.owner).not.toBeDefined();
44734473

44744474
tileset.clippingPolygons = collectionA;
4475+
expect(collectionA.owner).toBe(tileset);
4476+
44754477
const collectionB = new ClippingPolygonCollection({
44764478
polygons: [polygon],
44774479
});
44784480

4481+
// Attaching a new collection detaches the previous one; it is not destroyed.
44794482
tileset.clippingPolygons = collectionB;
4480-
expect(collectionA.isDestroyed()).toBe(true);
4483+
expect(tileset.clippingPolygons).toBe(collectionB);
4484+
expect(collectionA.length).toBe(1);
44814485

4486+
// Removing the tileset detaches its collection without destroying it.
44824487
scene.primitives.remove(tileset);
4483-
expect(collectionB.isDestroyed()).toBe(true);
4488+
expect(collectionB.length).toBe(1);
44844489
});
44854490

44864491
it("throws a DeveloperError when given a ClippingPolygonCollection attached to another tileset", async function () {

0 commit comments

Comments
 (0)