Commit 1c4b753e authored by Konstantin Schulz's avatar Konstantin Schulz
Browse files

fixed unit tests

parent 4fe65605
Pipeline #11074 passed with stage
in 2 minutes and 23 seconds
{ {
"name": "mc_frontend", "name": "mc_frontend",
"version": "1.8.0", "version": "1.8.1",
"author": "Ionic Framework", "author": "Ionic Framework",
"homepage": "https://ionicframework.com/", "homepage": "https://ionicframework.com/",
"scripts": { "scripts": {
......
...@@ -129,6 +129,7 @@ describe('ExerciseParametersPage', () => { ...@@ -129,6 +129,7 @@ describe('ExerciseParametersPage', () => {
Promise.resolve(new AnnisResponse())); Promise.resolve(new AnnisResponse()));
const navSpy: Spy = spyOn(exerciseParametersPage.helperService, 'goToPreviewPage').and.returnValue(Promise.resolve(true)); const navSpy: Spy = spyOn(exerciseParametersPage.helperService, 'goToPreviewPage').and.returnValue(Promise.resolve(true));
exerciseParametersPage.corpusService.annisResponse = new AnnisResponse(); exerciseParametersPage.corpusService.annisResponse = new AnnisResponse();
exerciseParametersPage.helperService.applicationState.next(exerciseParametersPage.helperService.deepCopy(MockMC.applicationState));
exerciseParametersPage.getH5Pexercise(new FormData()).then(() => { exerciseParametersPage.getH5Pexercise(new FormData()).then(() => {
expect(navSpy).toHaveBeenCalledTimes(1); expect(navSpy).toHaveBeenCalledTimes(1);
requestSpy.and.callFake(() => Promise.reject()); requestSpy.and.callFake(() => Promise.reject());
......
...@@ -124,7 +124,7 @@ export class PreviewPage implements OnDestroy, OnInit { ...@@ -124,7 +124,7 @@ export class PreviewPage implements OnDestroy, OnInit {
return new Promise<void>((resolve, reject) => { return new Promise<void>((resolve, reject) => {
const fileUrl: string = configMC.backendBaseUrl + configMC.backendApiFilePath; const fileUrl: string = configMC.backendBaseUrl + configMC.backendApiFilePath;
const formData = new FormData(); const formData = new FormData();
formData.append('learning_result', JSON.stringify(result.statement)); formData.append('learning_result', JSON.stringify({0: result.statement}));
this.helperService.makePostRequest(this.http, this.toastCtrl, fileUrl, formData, '').then(() => { this.helperService.makePostRequest(this.http, this.toastCtrl, fileUrl, formData, '').then(() => {
return resolve(); return resolve();
}, () => { }, () => {
......
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
<ion-col> <ion-col>
<ion-card> <ion-card>
<ion-item *ngIf="isTestMode"> <ion-item *ngIf="isTestMode">
<ion-icon name="stats" slot="start"></ion-icon> <ion-icon name="stats-chart" slot="start"></ion-icon>
<ion-label position="stacked"> <ion-label position="stacked">
<h2>{{ 'RESULT' | translate }} {{ 'UNIT_DIAGNOSIS_TITLE' | translate}}:</h2></ion-label> <h2>{{ 'RESULT' | translate }} {{ 'UNIT_DIAGNOSIS_TITLE' | translate}}:</h2></ion-label>
<br> <br>
......
Supports Markdown
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