"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

var _QtiImport = _interopRequireDefault(require("../QtiImport"));

describe('QtiImport Record', function () {
  describe('#isImporting', function () {
    it('returns true if status is "started"', function () {
      var inProgressImport = new _QtiImport.default({
        status: 'importing'
      });
      expect(inProgressImport.isImporting()).to.be.true();
    });
    it('returns false if status is "completed"', function () {
      var doneImport = new _QtiImport.default({
        status: 'completed'
      });
      expect(doneImport.isImporting()).to.be.false();
    });
  });
  describe('#progressNumber', function () {
    var progressNum = 0.3;
    context('status is importing', function () {
      it('returns the proress value', function () {
        var inProgressImport = new _QtiImport.default({
          status: 'importing',
          progress: progressNum
        });
        expect(inProgressImport.progressNumber()).to.be.equal(progressNum);
      });
    });
    context('status is completed', function () {
      it('returns 1.0 regardless of progress value', function () {
        var doneImport = new _QtiImport.default({
          status: 'completed',
          progress: progressNum
        });
        expect(doneImport.progressNumber()).to.be.equal(1.0);
      });
    });
    context('failed stauts', function () {
      it('returns 0.0 regardless of progress value', function () {
        var failedImport = new _QtiImport.default({
          status: 'failed',
          progress: progressNum
        });
        expect(failedImport.progressNumber()).to.be.equal(0.0);
      });
    });
  });
});