fix: falende tests gefixt door verandering in handmatige ids van assignment
This commit is contained in:
parent
14fce104a1
commit
78cb7812a7
4 changed files with 13 additions and 13 deletions
|
@ -16,7 +16,7 @@ describe('AssignmentRepository', () => {
|
||||||
|
|
||||||
it('should return the requested assignment', async () => {
|
it('should return the requested assignment', async () => {
|
||||||
const class_ = await classRepository.findById('34d484a1-295f-4e9f-bfdc-3e7a23d86a89');
|
const class_ = await classRepository.findById('34d484a1-295f-4e9f-bfdc-3e7a23d86a89');
|
||||||
const assignment = await assignmentRepository.findByClassAndId(class_!, 2);
|
const assignment = await assignmentRepository.findByClassAndId(class_!, 21001);
|
||||||
|
|
||||||
expect(assignment).toBeTruthy();
|
expect(assignment).toBeTruthy();
|
||||||
expect(assignment!.title).toBe('tool');
|
expect(assignment!.title).toBe('tool');
|
||||||
|
@ -35,7 +35,7 @@ describe('AssignmentRepository', () => {
|
||||||
const result = await assignmentRepository.findAllByResponsibleTeacher('testleerkracht1');
|
const result = await assignmentRepository.findAllByResponsibleTeacher('testleerkracht1');
|
||||||
const resultIds = result.map((it) => it.id).sort((a, b) => (a ?? 0) - (b ?? 0));
|
const resultIds = result.map((it) => it.id).sort((a, b) => (a ?? 0) - (b ?? 0));
|
||||||
|
|
||||||
expect(resultIds).toEqual([1, 3, 4]);
|
expect(resultIds).toEqual([ 21000, 21002, 21003 ]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not find removed assignment', async () => {
|
it('should not find removed assignment', async () => {
|
||||||
|
|
|
@ -19,16 +19,16 @@ describe('GroupRepository', () => {
|
||||||
|
|
||||||
it('should return the requested group', async () => {
|
it('should return the requested group', async () => {
|
||||||
const class_ = await classRepository.findById('8764b861-90a6-42e5-9732-c0d9eb2f55f9');
|
const class_ = await classRepository.findById('8764b861-90a6-42e5-9732-c0d9eb2f55f9');
|
||||||
const assignment = await assignmentRepository.findByClassAndId(class_!, 1);
|
const assignment = await assignmentRepository.findByClassAndId(class_!, 21000);
|
||||||
|
|
||||||
const group = await groupRepository.findByAssignmentAndGroupNumber(assignment!, 1);
|
const group = await groupRepository.findByAssignmentAndGroupNumber(assignment!, 21001);
|
||||||
|
|
||||||
expect(group).toBeTruthy();
|
expect(group).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return all groups for assignment', async () => {
|
it('should return all groups for assignment', async () => {
|
||||||
const class_ = await classRepository.findById('8764b861-90a6-42e5-9732-c0d9eb2f55f9');
|
const class_ = await classRepository.findById('8764b861-90a6-42e5-9732-c0d9eb2f55f9');
|
||||||
const assignment = await assignmentRepository.findByClassAndId(class_!, 1);
|
const assignment = await assignmentRepository.findByClassAndId(class_!, 21000);
|
||||||
|
|
||||||
const groups = await groupRepository.findAllGroupsForAssignment(assignment!);
|
const groups = await groupRepository.findAllGroupsForAssignment(assignment!);
|
||||||
|
|
||||||
|
@ -38,9 +38,9 @@ describe('GroupRepository', () => {
|
||||||
|
|
||||||
it('should not find removed group', async () => {
|
it('should not find removed group', async () => {
|
||||||
const class_ = await classRepository.findById('34d484a1-295f-4e9f-bfdc-3e7a23d86a89');
|
const class_ = await classRepository.findById('34d484a1-295f-4e9f-bfdc-3e7a23d86a89');
|
||||||
const assignment = await assignmentRepository.findByClassAndId(class_!, 2);
|
const assignment = await assignmentRepository.findByClassAndId(class_!, 21001);
|
||||||
|
|
||||||
await groupRepository.deleteByAssignmentAndGroupNumber(assignment!, 1);
|
await groupRepository.deleteByAssignmentAndGroupNumber(assignment!, 21001);
|
||||||
|
|
||||||
const group = await groupRepository.findByAssignmentAndGroupNumber(assignment!, 1);
|
const group = await groupRepository.findByAssignmentAndGroupNumber(assignment!, 1);
|
||||||
|
|
||||||
|
|
|
@ -54,8 +54,8 @@ describe('SubmissionRepository', () => {
|
||||||
it('should find the most recent submission for a group', async () => {
|
it('should find the most recent submission for a group', async () => {
|
||||||
const id = new LearningObjectIdentifier('id03', Language.English, 1);
|
const id = new LearningObjectIdentifier('id03', Language.English, 1);
|
||||||
const class_ = await classRepository.findById('8764b861-90a6-42e5-9732-c0d9eb2f55f9');
|
const class_ = await classRepository.findById('8764b861-90a6-42e5-9732-c0d9eb2f55f9');
|
||||||
const assignment = await assignmentRepository.findByClassAndId(class_!, 1);
|
const assignment = await assignmentRepository.findByClassAndId(class_!, 21000);
|
||||||
const group = await groupRepository.findByAssignmentAndGroupNumber(assignment!, 1);
|
const group = await groupRepository.findByAssignmentAndGroupNumber(assignment!, 21001);
|
||||||
const submission = await submissionRepository.findMostRecentSubmissionForGroup(id, group!);
|
const submission = await submissionRepository.findMostRecentSubmissionForGroup(id, group!);
|
||||||
|
|
||||||
expect(submission).toBeTruthy();
|
expect(submission).toBeTruthy();
|
||||||
|
@ -67,7 +67,7 @@ describe('SubmissionRepository', () => {
|
||||||
let loId: LearningObjectIdentifier;
|
let loId: LearningObjectIdentifier;
|
||||||
it('should find all submissions for a certain learning object and assignment', async () => {
|
it('should find all submissions for a certain learning object and assignment', async () => {
|
||||||
clazz = await classRepository.findById('8764b861-90a6-42e5-9732-c0d9eb2f55f9');
|
clazz = await classRepository.findById('8764b861-90a6-42e5-9732-c0d9eb2f55f9');
|
||||||
assignment = await assignmentRepository.findByClassAndId(clazz!, 1);
|
assignment = await assignmentRepository.findByClassAndId(clazz!, 21000);
|
||||||
loId = {
|
loId = {
|
||||||
hruid: 'id02',
|
hruid: 'id02',
|
||||||
language: Language.English,
|
language: Language.English,
|
||||||
|
|
|
@ -38,8 +38,8 @@ describe('QuestionRepository', () => {
|
||||||
const student = await studentRepository.findByUsername('Noordkaap');
|
const student = await studentRepository.findByUsername('Noordkaap');
|
||||||
|
|
||||||
const clazz = await getClassRepository().findById('8764b861-90a6-42e5-9732-c0d9eb2f55f9');
|
const clazz = await getClassRepository().findById('8764b861-90a6-42e5-9732-c0d9eb2f55f9');
|
||||||
const assignment = await getAssignmentRepository().findByClassAndId(clazz!, 1);
|
const assignment = await getAssignmentRepository().findByClassAndId(clazz!, 21000);
|
||||||
const group = await getGroupRepository().findByAssignmentAndGroupNumber(assignment!, 1);
|
const group = await getGroupRepository().findByAssignmentAndGroupNumber(assignment!, 21001);
|
||||||
await questionRepository.createQuestion({
|
await questionRepository.createQuestion({
|
||||||
loId: id,
|
loId: id,
|
||||||
inGroup: group!,
|
inGroup: group!,
|
||||||
|
@ -57,7 +57,7 @@ describe('QuestionRepository', () => {
|
||||||
let loId: LearningObjectIdentifier;
|
let loId: LearningObjectIdentifier;
|
||||||
it('should find all questions for a certain learning object and assignment', async () => {
|
it('should find all questions for a certain learning object and assignment', async () => {
|
||||||
clazz = await getClassRepository().findById('8764b861-90a6-42e5-9732-c0d9eb2f55f9');
|
clazz = await getClassRepository().findById('8764b861-90a6-42e5-9732-c0d9eb2f55f9');
|
||||||
assignment = await getAssignmentRepository().findByClassAndId(clazz!, 1);
|
assignment = await getAssignmentRepository().findByClassAndId(clazz!, 21000);
|
||||||
loId = {
|
loId = {
|
||||||
hruid: 'id05',
|
hruid: 'id05',
|
||||||
language: Language.English,
|
language: Language.English,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue