test: zet alle data klaar in de setup file en pas reeds gemaakte testen aan om met deze data te werken
This commit is contained in:
parent
595f248f11
commit
fcd9f66e28
6 changed files with 498 additions and 102 deletions
|
@ -1,29 +1,36 @@
|
|||
import { beforeAll, describe, expect, it } from "vitest";
|
||||
import { LearningPathRepository } from "../../src/data/content/learning-path-repository";
|
||||
import { getLearningPathRepository } from "../../src/data/repositories";
|
||||
import { setupTestApp } from "../setup-tests";
|
||||
import { Language } from "../../src/entities/content/language";
|
||||
import { beforeAll, describe, expect, it } from 'vitest';
|
||||
import { getLearningPathRepository } from '../../src/data/repositories';
|
||||
import { LearningPathRepository } from '../../src/data/content/learning-path-repository';
|
||||
import { setupTestApp } from '../setup-tests';
|
||||
import { Language } from '../../src/entities/content/language';
|
||||
|
||||
describe('LearningPathRepository', () => {
|
||||
let LearningPathRepository : LearningPathRepository;
|
||||
let LearningPathRepository: LearningPathRepository;
|
||||
|
||||
beforeAll(async () => {
|
||||
await setupTestApp();
|
||||
LearningPathRepository = getLearningPathRepository();
|
||||
});
|
||||
|
||||
it('should return nothing because no match for hruid and language', async() => {
|
||||
const learningPath = await LearningPathRepository.findByHruidAndLanguage('hruid_path01', Language.Dutch);
|
||||
it('should return nothing because no match for hruid and language', async () => {
|
||||
const learningPath =
|
||||
await LearningPathRepository.findByHruidAndLanguage(
|
||||
'test_id',
|
||||
Language.Dutch
|
||||
);
|
||||
|
||||
expect(learningPath).toBeNull();
|
||||
});
|
||||
|
||||
it('should return requested learning path', async() => {
|
||||
const learningPath = await LearningPathRepository.findByHruidAndLanguage('hruid_path01', Language.English);
|
||||
it('should return requested learning path', async () => {
|
||||
const learningPath =
|
||||
await LearningPathRepository.findByHruidAndLanguage(
|
||||
'id01',
|
||||
Language.English
|
||||
);
|
||||
|
||||
expect(learningPath).toBeTruthy();
|
||||
expect(learningPath?.title).toBe('repertoire Tool');
|
||||
expect(learningPath?.description).toBe('all about Tool');
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue