Skip to content

Commit

Permalink
Add tests for modified code
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Bellemare committed Aug 26, 2018
1 parent 9054efb commit 7bba114
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/baseAPI.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,28 @@
});
});

describe("#clearSCORMError", function() {
var anyLastErrorCode = 101;

beforeEach(function() {
api.lastErrorCode = anyLastErrorCode;
});

context("given a success", function() {
it("should clear the last SCORM error", function() {
api.clearSCORMError(constants.SCORM_TRUE);
expect(api.lastErrorCode).to.equal(0);
});
});

context("given a failure", function() {
it("should not clear the last SCORM error", function() {
api.clearSCORMError(constants.SCORM_FALSE);
expect(api.lastErrorCode).to.equal(anyLastErrorCode);
});
});
});

describe("#getLmsErrorMessageDetails", function() {
it("should return no error", function() {
expect(api.getLmsErrorMessageDetails()).to.equal("No error");
Expand Down

0 comments on commit 7bba114

Please sign in to comment.