"use strict";

var _chai = require("chai");

var _upload = require("../upload");

var _constants = require("@instructure/quiz-common/lib/constants");

describe('upload action creators', function () {
  it('returns a well-formed receiveFile action', function () {
    var file = 'file';
    var receiveFileObj = (0, _upload.receiveFile)(file);
    (0, _chai.expect)(receiveFileObj).to.deep.equal({
      type: _constants.FILE_RECEIVED,
      payload: {
        file: file
      }
    });
  });
  it('returns a well-formed clearAltText action', function () {
    var clearAltTextObj = (0, _upload.clearAltText)();
    (0, _chai.expect)(clearAltTextObj).to.deep.equal({
      type: _constants.CLEAR_ALT_TEXT
    });
  });
  it('returns a well-formed clearFiles action', function () {
    var clearFilesObj = (0, _upload.clearFiles)();
    (0, _chai.expect)(clearFilesObj).to.deep.equal({
      type: _constants.CLEAR_FILES
    });
  });
  it('returns a well-formed uploadStatus action', function () {
    var uploadStatusObj = (0, _upload.uploadStatus)('ASTATUS');
    (0, _chai.expect)(uploadStatusObj).to.deep.eq({
      type: _constants.FILE_UPLOAD_STATUS,
      payload: {
        status: 'ASTATUS'
      }
    });
  });
  it('returns a well-formed setAltText action', function () {
    var setAltTextObj = (0, _upload.setAltText)('some alt text');
    (0, _chai.expect)(setAltTextObj).to.deep.eq({
      type: _constants.SET_ALT_TEXT,
      payload: {
        altText: 'some alt text'
      }
    });
  });
});