Fixing a few tests
This commit is contained in:
@@ -161,13 +161,13 @@ export const scorm12_values = {
|
|||||||
'P1DT23H59M59S',
|
'P1DT23H59M59S',
|
||||||
],
|
],
|
||||||
|
|
||||||
validTimestamp: [
|
validTimespan: [
|
||||||
'10:06:57',
|
'10:06:57',
|
||||||
'00:00:01.56',
|
'00:00:01.56',
|
||||||
'23:59:59',
|
'23:59:59',
|
||||||
'47:59:59',
|
'47:59:59',
|
||||||
],
|
],
|
||||||
invalidTimestamp: [
|
invalidTimespan: [
|
||||||
'06:5:13',
|
'06:5:13',
|
||||||
'23:59:59.123',
|
'23:59:59.123',
|
||||||
'P1DT23H59M59S',
|
'P1DT23H59M59S',
|
||||||
|
|||||||
@@ -244,6 +244,29 @@ describe('AICC API Tests', () => {
|
|||||||
fieldName: 'cmi.interactions.0.id',
|
fieldName: 'cmi.interactions.0.id',
|
||||||
valueToTest: 'AAA',
|
valueToTest: 'AAA',
|
||||||
});
|
});
|
||||||
|
h.checkLMSSetValue({
|
||||||
|
api: apiInitialized(),
|
||||||
|
fieldName: 'cmi.evaluation.comments.0.content',
|
||||||
|
valueToTest: 'AAA',
|
||||||
|
});
|
||||||
|
h.checkLMSSetValue({
|
||||||
|
api: apiInitialized(),
|
||||||
|
fieldName: 'cmi.student_data.tries.0.score.max',
|
||||||
|
valueToTest: '100',
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
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');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -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', () => {
|
describe('Write-Only Properties - Should Always Fail', () => {
|
||||||
h.checkLMSGetValue({
|
h.checkLMSGetValue({
|
||||||
api: apiInitialized(),
|
api: apiInitialized(),
|
||||||
@@ -214,6 +224,8 @@ describe('SCORM 1.2 API Tests', () => {
|
|||||||
api: apiInitialized(),
|
api: apiInitialized(),
|
||||||
fieldName: 'cmi.interactions.0.correct_responses.0.pattern',
|
fieldName: 'cmi.interactions.0.correct_responses.0.pattern',
|
||||||
initializeFirst: true,
|
initializeFirst: true,
|
||||||
|
initializationValue: 'AAA',
|
||||||
|
expectedValue: 'AAA',
|
||||||
expectedError: scorm12_error_codes.WRITE_ONLY_ELEMENT,
|
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');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -195,8 +195,8 @@ describe('SCORM 1.2 CMI Tests', () => {
|
|||||||
h.checkValidValues({
|
h.checkValidValues({
|
||||||
cmi: cmi(),
|
cmi: cmi(),
|
||||||
fieldName: 'cmi.core.session_time',
|
fieldName: 'cmi.core.session_time',
|
||||||
validValues: scorm12_values.validHHMMSS,
|
validValues: scorm12_values.validTimespan,
|
||||||
invalidValues: scorm12_values.invalidHHMMSS,
|
invalidValues: scorm12_values.invalidTimespan,
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -458,8 +458,8 @@ describe('SCORM 1.2 CMI Tests', () => {
|
|||||||
h.checkValidValues({
|
h.checkValidValues({
|
||||||
cmi: cmiInitialized(),
|
cmi: cmiInitialized(),
|
||||||
fieldName: 'cmi.core.session_time',
|
fieldName: 'cmi.core.session_time',
|
||||||
validValues: scorm12_values.validHHMMSS,
|
validValues: scorm12_values.validTimespan,
|
||||||
invalidValues: scorm12_values.invalidHHMMSS,
|
invalidValues: scorm12_values.invalidTimespan,
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -686,8 +686,8 @@ describe('SCORM 1.2 CMI Tests', () => {
|
|||||||
h.checkValidValues({
|
h.checkValidValues({
|
||||||
cmi: interaction(),
|
cmi: interaction(),
|
||||||
fieldName: 'cmi.latency',
|
fieldName: 'cmi.latency',
|
||||||
validValues: scorm12_values.validTimestamp,
|
validValues: scorm12_values.validTimespan,
|
||||||
invalidValues: scorm12_values.invalidTimestamp,
|
invalidValues: scorm12_values.invalidTimespan,
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should export JSON', () => {
|
it('should export JSON', () => {
|
||||||
@@ -722,7 +722,6 @@ describe('SCORM 1.2 CMI Tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('CMIInteractionsCorrectResponsesObject Tests', () => {
|
describe('CMIInteractionsCorrectResponsesObject Tests', () => {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cmi.interactions.n.correct_responses.n object
|
* cmi.interactions.n.correct_responses.n object
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user