Commit 4694eea6 authored by Konstantin Schulz's avatar Konstantin Schulz
Browse files

fixed unit test for corpus service initialization

parent b82bc000
Pipeline #12410 passed with stages
in 2 minutes and 39 seconds
...@@ -233,6 +233,7 @@ describe('CorpusService', () => { ...@@ -233,6 +233,7 @@ describe('CorpusService', () => {
it('should initialize the corpus service', (done) => { it('should initialize the corpus service', (done) => {
const restoreSpy: Spy = spyOn(corpusService, 'restoreLastCorpus').and.returnValue(Promise.resolve()); const restoreSpy: Spy = spyOn(corpusService, 'restoreLastCorpus').and.returnValue(Promise.resolve());
const updateInfoSpy: Spy = spyOn(corpusService, 'initUpdateInfo').and.callFake(() => Promise.reject()); const updateInfoSpy: Spy = spyOn(corpusService, 'initUpdateInfo').and.callFake(() => Promise.reject());
helperService.applicationState.next(helperService.deepCopy(MockMC.applicationState) as ApplicationState);
corpusService.initCorpusService().then(() => { corpusService.initCorpusService().then(() => {
}, () => { }, () => {
corpusService.translate.onLangChange.next(); corpusService.translate.onLangChange.next();
......
...@@ -68,10 +68,8 @@ export class PreviewPage implements AfterContentInit, OnDestroy, OnInit { ...@@ -68,10 +68,8 @@ export class PreviewPage implements AfterContentInit, OnDestroy, OnInit {
} }
ngAfterContentInit(): Promise<void> { ngAfterContentInit(): Promise<void> {
console.log('INIT');
return new Promise<void>(resolve => { return new Promise<void>(resolve => {
this.corpusService.checkAnnisResponse().then(() => { this.corpusService.checkAnnisResponse().then(() => {
console.log('CHECK RESOLVED');
this.processAnnisResponse(this.corpusService.annisResponse); this.processAnnisResponse(this.corpusService.annisResponse);
this.initH5P(); this.initH5P();
return resolve(); return resolve();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment