Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jjspace committed Jul 26, 2024
1 parent 1fcff06 commit 481b372
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
12 changes: 7 additions & 5 deletions packages/engine/Source/Scene/BingMapsImageryProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,13 @@ function metadataSuccess(data, imageryProviderBuilder) {
imageryProviderBuilder.maximumLevel = resource.zoomMax - 1;
imageryProviderBuilder.imageUrlSubdomains = resource.imageUrlSubdomains;
imageryProviderBuilder.imageUrlTemplate = resource.imageUrl;
const validProviders = resource.imageryProviders.filter((provider) =>
// prevent issues with the imagery API from crashing the viewer when the expected properties are not there
// See https://github.com/CesiumGS/cesium/issues/12088
provider.coverageAreas?.some((area) => defined(area.bbox))
);
const validProviders = !defined(resource.imageryProviders)
? resource.imageryProviders
: resource.imageryProviders.filter((provider) =>
// prevent issues with the imagery API from crashing the viewer when the expected properties are not there
// See https://github.com/CesiumGS/cesium/issues/12088
provider.coverageAreas?.some((area) => defined(area.bbox))
);
imageryProviderBuilder.attributionList = validProviders;
}

Expand Down
8 changes: 5 additions & 3 deletions packages/engine/Specs/Scene/BingMapsImageryProviderSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ describe("Scene/BingMapsImageryProvider", function () {
});

//These are the same instance only if the cache has been used
expect(provider._attributionList).toBe(provider2._attributionList);
expect(provider._imageUrlSubdomains).toBe(provider2._imageUrlSubdomains);

installFakeMetadataRequest(url, BingMapsStyle.AERIAL);
installFakeImageRequest();
Expand All @@ -253,8 +253,10 @@ describe("Scene/BingMapsImageryProvider", function () {
mapStyle: BingMapsStyle.AERIAL,
});

// Because the road is different, a non-cached request should have happened
expect(provider3._attributionList).not.toBe(provider._attributionList);
// Because the style is different, a non-cached request should have happened
expect(provider3._imageUrlSubdomains).not.toBe(
provider._imageUrlSubdomains
);
});

it("fromUrl resolves with a path", async function () {
Expand Down

0 comments on commit 481b372

Please sign in to comment.