fix(backend): Fouten in isTransitionPossible en het opzetten van de testdata verbeterd.
This commit is contained in:
parent
b539c28d8c
commit
fc46e79d05
10 changed files with 249 additions and 68 deletions
|
@ -3,6 +3,7 @@ import { LearningObject } from '../../../../src/entities/content/learning-object
|
|||
import { Language } from '../../../../src/entities/content/language';
|
||||
import { loadTestAsset } from '../../../test-utils/load-test-asset';
|
||||
import { DwengoContentType } from '../../../../src/services/learning-objects/processing/content-type';
|
||||
import {EnvVars, getEnvVar} from "../../../../src/util/envvars";
|
||||
|
||||
/**
|
||||
* Create a dummy learning object to be used in tests where multiple learning objects are needed (for example for use
|
||||
|
@ -12,13 +13,17 @@ export function dummyLearningObject(hruid: string, language: Language, title: st
|
|||
return {
|
||||
createLearningObject: () => {
|
||||
const learningObject = new LearningObject();
|
||||
learningObject.hruid = hruid;
|
||||
learningObject.hruid = getEnvVar(EnvVars.UserContentPrefix) + hruid;
|
||||
learningObject.language = language;
|
||||
learningObject.version = 1;
|
||||
learningObject.title = title;
|
||||
learningObject.description = 'Just a dummy learning object for testing purposes';
|
||||
learningObject.contentType = DwengoContentType.TEXT_PLAIN;
|
||||
learningObject.content = Buffer.from('Dummy content');
|
||||
learningObject.returnValue = {
|
||||
callbackUrl: `/learningObject/${hruid}/submissions`,
|
||||
callbackSchema: "[]"
|
||||
}
|
||||
return learningObject;
|
||||
},
|
||||
createAttachment: {},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue