"use strict";

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

var _ElapsedTime = _interopRequireDefault(require("../ElapsedTime"));

describe('ElapsedTime', function () {
  var constructDate = function constructDate() {
    var hours = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
    var minutes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
    var seconds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
    return new Date(2000, 0, 1, hours, minutes, seconds);
  };

  var startTime = constructDate();
  var eventTime = constructDate();
  var testbed = createTestbed(_ElapsedTime.default, {
    startTime: startTime,
    eventTime: eventTime
  });
  it('renders the difference in time in mm::ss', function () {
    testbed.render();
    expect(testbed.getText(testbed.rootNode)).to.equal('00:00');
  });
  it('extends to include hh:mm:ss', function () {
    var eventTime = constructDate(1, 2, 3);
    testbed.render({
      eventTime: eventTime
    });
    expect(testbed.getText(testbed.rootNode)).to.equal('01:02:03');
  });
});