Fixing a few tests

This commit is contained in:
Jonathan Putney
2019-11-14 21:53:32 -05:00
parent dd4d8efec9
commit 7cdbf4c4c0
4 changed files with 56 additions and 9 deletions

View File

@@ -151,6 +151,16 @@ describe('SCORM 1.2 API Tests', () => {
});
});
describe('Read and Write Properties - Should Success', () => {
h.checkLMSGetValue({
api: apiInitialized(),
fieldName: 'cmi.interactions.0.objectives.0.id',
initializeFirst: true,
initializationValue: 'AAA',
expectedValue: 'AAA',
});
});
describe('Write-Only Properties - Should Always Fail', () => {
h.checkLMSGetValue({
api: apiInitialized(),
@@ -214,6 +224,8 @@ describe('SCORM 1.2 API Tests', () => {
api: apiInitialized(),
fieldName: 'cmi.interactions.0.correct_responses.0.pattern',
initializeFirst: true,
initializationValue: 'AAA',
expectedValue: 'AAA',
expectedError: scorm12_error_codes.WRITE_ONLY_ELEMENT,
});
});
@@ -246,4 +258,17 @@ describe('SCORM 1.2 API Tests', () => {
});
});
});
describe('replaceWithAnotherScormAPI()', () => {
const firstAPI = api();
const secondAPI = api();
firstAPI.cmi.core.student_id = 'student_1';
secondAPI.cmi.core.student_id = 'student_2';
firstAPI.replaceWithAnotherScormAPI(secondAPI);
expect(
firstAPI.cmi.core.student_id,
).to.equal('student_2');
});
});