mirror of
https://github.com/prymitive/karma
synced 2026-05-07 03:26:52 +00:00
feat(tests): add basic tests for DateTimeSelect
This commit is contained in:
25
ui/src/Components/SilenceModal/DateTimeSelect/index.test.js
Normal file
25
ui/src/Components/SilenceModal/DateTimeSelect/index.test.js
Normal 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/);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user