feat(tests): add basic tests for DateTimeSelect

This commit is contained in:
Łukasz Mierzwa
2018-08-29 19:05:53 +01:00
parent 241cd2fa08
commit edba052ecd

View File

@@ -0,0 +1,25 @@
import React from "react";
import { mount } from "enzyme";
import { SilenceFormStore } from "Stores/SilenceFormStore";
import { DateTimeSelect } from ".";
let silenceFormStore;
beforeEach(() => {
silenceFormStore = new SilenceFormStore();
});
const MountedDateTimeSelect = () => {
return mount(<DateTimeSelect silenceFormStore={silenceFormStore} />);
};
describe("<DateTimeSelect />", () => {
it("renders 'Duration' tab by default", () => {
const tree = MountedDateTimeSelect();
const tab = tree.find(".nav-link.active");
expect(tab).toHaveLength(1);
expect(tab.text()).toMatch(/Duration/);
});
});