Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
HARP-12868: Fix other tests and disable error logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
atomicsulfate committed Nov 10, 2020
1 parent 5bc615d commit 4b39b01
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 0 deletions.
10 changes: 10 additions & 0 deletions @here/harp-mapview-decoder/test/TileLoaderTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,28 @@ describe("TileLoader", function() {
let mapView: MapView;
let dataSource: DataSource;
let dataProvider: MockDataProvider;
let loggerWasEnabled = true;

before(function() {
tileKey = TileKey.fromRowColumnLevel(0, 0, 0);
mapView = createMockMapView();
dataSource = new MockDataSource();
dataSource.attach(mapView);
const logger = LoggerManager.instance.getLogger("BaseTileLoader");
if (logger) {
loggerWasEnabled = logger.enabled;
logger.enabled = false;
}
});

beforeEach(function() {
dataProvider = new MockDataProvider();
});

after(function() {
LoggerManager.instance.enable("BaseTileLoader", loggerWasEnabled);
});

describe("loadAndDecode()", function() {
it("should load tiles", function() {
const tileLoader = new TileLoader(
Expand Down
1 change: 1 addition & 0 deletions @here/harp-mapview/test/MapViewTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1512,6 +1512,7 @@ describe("MapView", function() {
getTilingScheme() {
return webMercatorTilingScheme;
},
setLanguages() {},
mapView: undefined
} as any;
fakeElevationRangeSource = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ describe("MapView Picking", async function() {
getTilingScheme() {
return webMercatorTilingScheme;
},
setLanguages() {},
mapView: undefined
} as any;
fakeElevationRangeSource = {
Expand Down
14 changes: 14 additions & 0 deletions @here/harp-webtile-datasource/test/WebTileLoaderTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import { TileKey, webMercatorProjection } from "@here/harp-geoutils";
import { CopyrightInfo, MapView, Tile, TileLoaderState } from "@here/harp-mapview";
import { LoggerManager } from "@here/harp-utils";
import * as chai from "chai";
import * as chaiAsPromised from "chai-as-promised";
import * as sinon from "sinon";
Expand All @@ -32,6 +33,15 @@ describe("WebTileLoader", function() {
const dataProvider: WebTileDataProvider = { getTexture: getTextureStub } as any;
let dataSource: WebTileDataSource;
let tile: Tile;
let loggerWasEnabled = true;

before(function() {
const logger = LoggerManager.instance.getLogger("BaseTileLoader");
if (logger) {
loggerWasEnabled = logger.enabled;
logger.enabled = false;
}
});

beforeEach(function() {
dataSource = new WebTileDataSource({
Expand All @@ -43,6 +53,10 @@ describe("WebTileLoader", function() {
getTextureStub.resolves([texture, copyRightInfo]);
});

after(function() {
LoggerManager.instance.enable("BaseTileLoader", loggerWasEnabled);
});

describe("loadAndDecode()", function() {
it("should load textured mesh and copyright info", function() {
const tileLoader = new WebTileLoader(dataSource, tile, dataProvider);
Expand Down
15 changes: 15 additions & 0 deletions @here/harp-webtile-datasource/test/WebTileTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { mercatorProjection, TileKey } from "@here/harp-geoutils";
import { CopyrightInfo, MapView, Tile } from "@here/harp-mapview";
import { TileGeometryCreator } from "@here/harp-mapview/lib/geometry/TileGeometryCreator";
import { LoggerManager } from "@here/harp-utils";
import { expect } from "chai";
import * as sinon from "sinon";

Expand All @@ -22,6 +23,20 @@ describe("WebTileDataSource", function() {
projection: mercatorProjection
} as MapView;

let loggerWasEnabled = true;

before(function() {
const logger = LoggerManager.instance.getLogger("BaseTileLoader");
if (logger) {
loggerWasEnabled = logger.enabled;
logger.enabled = false;
}
});

after(function() {
LoggerManager.instance.enable("BaseTileLoader", loggerWasEnabled);
});

it("#createWebTileDataSource has default values", async function() {
const webTileDataSource = new WebTileDataSource({
dataProvider: fakeWebTileProvider
Expand Down

0 comments on commit 4b39b01

Please sign in to comment.