More tests and fixes

This commit is contained in:
Jonathan Putney
2019-11-14 16:07:42 -05:00
parent caa5977a4b
commit 929176fb3e
14 changed files with 385 additions and 238 deletions

View File

@@ -140,3 +140,22 @@ export const checkValidValues = (
}
});
};
export const checkGetCurrentTotalTime = (
{
cmi: cmi,
totalFieldName,
sessionFieldName,
startingTotal,
sessionTime,
expectedTotal,
}) => {
it(`Should return ${expectedTotal} with a starting time of ${startingTotal} and a session time of ${sessionTime}`,
() => {
eval(`${totalFieldName} = '${startingTotal}'`);
eval(`${sessionFieldName} = '${sessionTime}'`);
expect(
cmi.getCurrentTotalTime(),
).to.equal(expectedTotal);
});
};