"use strict";

var _tape = _interopRequireDefault(require("tape"));

var _reduxBundler = require("redux-bundler");

var _appDay = require("./app-day");

var _date = require("../utils/date");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

const getStore = () => (0, _reduxBundler.composeBundlesRaw)(_reduxBundler.appTimeBundle, _appDay.appDayBundle)();

(0, _tape.default)('app-day bundle', t => {
  const store = getStore();
  t.equal(store.selectAppDayDate().valueOf(), (0, _date.getStartOfDate)(new Date()).valueOf());
  const startingAppDate = store.selectAppDayDate();
  const startingAppTime = store.selectAppTime(); // this should change app time

  setTimeout(() => {
    store.dispatch({
      type: 'something'
    });
    t.notEqual(startingAppTime, store.selectAppTime());
    t.equal(startingAppDate, store.selectAppDayDate(), 'date object should be same instance');
    t.end();
  }, 5);
});