From edba052ecda735d04528a6d250611bc94485c508 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Wed, 29 Aug 2018 19:05:53 +0100 Subject: [PATCH] feat(tests): add basic tests for DateTimeSelect --- .../SilenceModal/DateTimeSelect/index.test.js | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 ui/src/Components/SilenceModal/DateTimeSelect/index.test.js diff --git a/ui/src/Components/SilenceModal/DateTimeSelect/index.test.js b/ui/src/Components/SilenceModal/DateTimeSelect/index.test.js new file mode 100644 index 000000000..030b41091 --- /dev/null +++ b/ui/src/Components/SilenceModal/DateTimeSelect/index.test.js @@ -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(); +}; + +describe("", () => { + 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/); + }); +});