test: learning object repository is getest
This commit is contained in:
parent
714a3dab10
commit
6338ad249a
2 changed files with 88 additions and 0 deletions
|
@ -1,3 +1,5 @@
|
|||
import { Language } from '../src/entities/content/language.js';
|
||||
import { ContentType, LearningObject, ReturnValue } from '../src/entities/content/learning-object.entity.js';
|
||||
import { Student } from '../src/entities/users/student.entity.js';
|
||||
import { Teacher } from '../src/entities/users/teacher.entity.js';
|
||||
import { forkEntityManager, initORM } from '../src/orm.js';
|
||||
|
@ -20,4 +22,58 @@ export async function setupTestApp() {
|
|||
const teacher03 = em.create(Teacher, { username: 'TheDoors', firstName: 'Jim', lastName: 'Morrison'});
|
||||
|
||||
await em.persistAndFlush([teacher01, teacher02, teacher03]);
|
||||
|
||||
const admins01 = [teacher01];
|
||||
const returnValue = new ReturnValue();
|
||||
returnValue.callbackSchema = '';
|
||||
returnValue.callbackUrl = '';
|
||||
const buffer01 = new Buffer("there's a shadow just behind me, shrouding every step i take, making every promise empty pointing every finger at me");
|
||||
const learningObject01 = em.create(LearningObject, {
|
||||
hruid: 'hruid_object01',
|
||||
language: Language.English,
|
||||
version: '1',
|
||||
admins: admins01,
|
||||
title: 'Undertow',
|
||||
description: 'debute',
|
||||
contentType: ContentType.Markdown,
|
||||
keywords: [],
|
||||
teacherExclusive: false,
|
||||
skosConcepts: [],
|
||||
educationalGoals: [],
|
||||
copyright: '',
|
||||
license: '',
|
||||
estimatedTime: 45,
|
||||
returnValue: returnValue,
|
||||
available: true,
|
||||
contentLocation: '',
|
||||
attachments: [],
|
||||
content: buffer01
|
||||
});
|
||||
|
||||
const admins02 = [teacher02];
|
||||
const buffer02 = new Buffer("cause it's always raining in my head, forget all the things I should have had said so I speak to you in riddles, because my words get in my way")
|
||||
const learningObject02 = em.create(LearningObject, {
|
||||
hruid: 'hruid_object02',
|
||||
language: Language.English,
|
||||
version: '1',
|
||||
admins: admins02,
|
||||
title: 'Break the cycle',
|
||||
description: 'second album',
|
||||
contentType: ContentType.Markdown,
|
||||
keywords: ["music"],
|
||||
teacherExclusive: false,
|
||||
skosConcepts: [],
|
||||
educationalGoals: [],
|
||||
copyright: '',
|
||||
license: '',
|
||||
estimatedTime: 55,
|
||||
returnValue: returnValue,
|
||||
available: true,
|
||||
contentLocation: '',
|
||||
attachments: [],
|
||||
content: buffer02
|
||||
});
|
||||
|
||||
await em.persistAndFlush([learningObject01, learningObject02]);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue