Fixes and additional test cases

This commit is contained in:
Jonathan Putney
2019-11-15 21:54:49 -05:00
parent 4dda8820ee
commit d548330436
7 changed files with 95 additions and 34 deletions

View File

@@ -272,6 +272,19 @@ describe('SCORM 1.2 API Tests', () => {
).to.equal('student_2');
});
describe('renderCommitCMI()', () => {
it('should calculate total time when terminateCommit passed',
() => {
const scorm12API = api();
scorm12API.cmi.core.total_time = '12:34:56';
scorm12API.cmi.core.session_time = '23:59:59';
const cmiExport = scorm12API.renderCommitCMI(true);
expect(
cmiExport.cmi.core.total_time
).to.equal('36:34:55');
});
});
describe('storeData()', () => {
it('should set cmi.core.lesson_status to "completed"', () => {
const scorm12API = api();