mapillary-js/spec/viewer/LoadingService.spec.ts
Oscar Lorentzon 8066b9c52a Use Typings instead of TSD.
Remove deprecated TSD dependency.
Use Typings to install type definitions.
Install rx typings from npm package.
2016-02-29 16:58:56 +01:00

32 lines
795 B
TypeScript

/// <reference path="../../typings/browser.d.ts" />
import {LoadingService} from "../../src/Viewer";
describe("LoadingService", () => {
var loadingService: LoadingService;
beforeEach(() => {
loadingService = new LoadingService();
});
it("should emit loading status", (done) => {
loadingService.loading$.subscribe((loading: boolean) => {
expect(loading).toBe(true);
done();
});
loadingService.startLoading("task");
});
it("should emit not loading status", (done) => {
loadingService.startLoading("test");
loadingService.loading$.subscribe((loading: boolean) => {
expect(loading).toBe(false);
done();
});
loadingService.stopLoading("task");
});
});