{"size": 1263, "ext": "js", "max_stars_repo_path": "tests/unit/timelapse/DatePicker.spec.js", "max_stars_repo_name": "JIB-8352/chatham_smart_map", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "tests/unit/timelapse/DatePicker.spec.js", "max_issues_repo_name": "JIB-8352/chatham_smart_map", "max_issues_repo_issues_event_min_datetime": "2019-01-18T16:34:45.000Z", "max_issues_repo_issues_event_max_datetime": "2021-10-05T20:16:28.000Z", "max_forks_repo_path": "tests/unit/timelapse/DatePicker.spec.js", "max_forks_repo_name": "JIB-8352/chatham_smart_map", "max_forks_repo_forks_event_min_datetime": "2019-01-18T15:47:34.000Z", "max_forks_repo_forks_event_max_datetime": "2019-01-18T15:52:44.000Z"}
{"max_stars_count": null, "max_issues_count": 106, "max_forks_count": 5, "avg_line_length": 30.0714285714, "max_line_length": 75, "alphanum_fraction": 0.665874901}
import Vuex from "vuex";
import app from "@/store/modules/app";
import timelapse from "@/store/modules/timelapse";
import { shallowMount, createLocalVue } from "@vue/test-utils";
import DatePicker from "@/components/timelapse/DatePicker";

const localVue = createLocalVue();
localVue.use(Vuex);

const store = new Vuex.Store({
  modules: {
    app,
    timelapse
  }
});

describe("DatePicker", () => {
  const wrapper = shallowMount(DatePicker, { store, localVue });

  it("has the expected elements", () => {
    expect(wrapper.find("div.datepicker-trigger").exists()).toBe(true);
    expect(wrapper.contains(".first")).toBe(true);
    expect(wrapper.contains("div.vertical-line")).toBe(true);
    expect(wrapper.contains(".second")).toBe(true);
    expect(wrapper.find("i").text()).toEqual("calendar_today");
    expect(wrapper.contains("airbnbstyledatepicker")).toBe(true);
  });

  it("div is disabled by default", () => {
    expect(wrapper.find("div.datepicker-trigger").classes()).toContain(
      "disabled"
    );
  });

  it("input is enabled when updatingData = false", () => {
    store.commit("app/updatingData", { updatingData: false });
    expect(wrapper.find("div.datepicker-trigger").classes()).not.toContain(
      "disabled"
    );
  });
});
