fix: pas testen aan zodat ze ook werken op windows

This commit is contained in:
Laure Jablonski 2025-03-15 17:50:19 +01:00
parent 99b77ffb5a
commit 24935f0e95
3 changed files with 5 additions and 5 deletions

View file

@ -60,7 +60,7 @@ describe('DatabaseLearningObjectProvider', () => {
describe('getLearningObjectHTML', () => { describe('getLearningObjectHTML', () => {
it('should return the correct rendering of the learning object', async () => { it('should return the correct rendering of the learning object', async () => {
const result = await databaseLearningObjectProvider.getLearningObjectHTML(exampleLearningObject); const result = await databaseLearningObjectProvider.getLearningObjectHTML(exampleLearningObject);
expect(result).toEqual(example.getHTMLRendering()); expect(result).toEqual(example.getHTMLRendering().replace(/\r\n/g, '\n'));
}); });
it('should return null for a non-existing learning object', async () => { it('should return null for a non-existing learning object', async () => {
const result = await databaseLearningObjectProvider.getLearningObjectHTML({ const result = await databaseLearningObjectProvider.getLearningObjectHTML({

View file

@ -68,7 +68,7 @@ describe('LearningObjectService', () => {
it('returns the expected HTML when queried with the identifier of a learning object saved in the database', async () => { it('returns the expected HTML when queried with the identifier of a learning object saved in the database', async () => {
const result = await learningObjectService.getLearningObjectHTML(exampleLearningObject); const result = await learningObjectService.getLearningObjectHTML(exampleLearningObject);
expect(result).not.toBeNull(); expect(result).not.toBeNull();
expect(result).toEqual(learningObjectExample.getHTMLRendering()); expect(result).toEqual(learningObjectExample.getHTMLRendering().replace(/\r\n/g, '\n'));
}); });
it( it(
'returns the same HTML as the Dwengo API when queried with the identifier of a learning object that does ' + 'returns the same HTML as the Dwengo API when queried with the identifier of a learning object that does ' +

View file

@ -8,18 +8,18 @@ describe('ProcessingService', () => {
it('renders a markdown learning object correctly', async () => { it('renders a markdown learning object correctly', async () => {
const markdownLearningObject = mdExample.createLearningObject(); const markdownLearningObject = mdExample.createLearningObject();
const result = await processingService.render(markdownLearningObject); const result = await processingService.render(markdownLearningObject);
expect(result).toEqual(mdExample.getHTMLRendering()); expect(result).toEqual(mdExample.getHTMLRendering().replace(/\r\n/g, '\n'));
}); });
it('renders a multiple choice question correctly', async () => { it('renders a multiple choice question correctly', async () => {
const multipleChoiceLearningObject = multipleChoiceExample.createLearningObject(); const multipleChoiceLearningObject = multipleChoiceExample.createLearningObject();
const result = await processingService.render(multipleChoiceLearningObject); const result = await processingService.render(multipleChoiceLearningObject);
expect(result).toEqual(multipleChoiceExample.getHTMLRendering()); expect(result).toEqual(multipleChoiceExample.getHTMLRendering().replace(/\r\n/g, '\n'));
}); });
it('renders an essay question correctly', async () => { it('renders an essay question correctly', async () => {
const essayLearningObject = essayExample.createLearningObject(); const essayLearningObject = essayExample.createLearningObject();
const result = await processingService.render(essayLearningObject); const result = await processingService.render(essayLearningObject);
expect(result).toEqual(essayExample.getHTMLRendering()); expect(result).toEqual(essayExample.getHTMLRendering().replace(/\r\n/g, '\n'));
}); });
}); });