1
0
mirror of https://gitlab.nic.cz/turris/reforis/foris-js.git synced 2025-08-07 20:43:45 +02:00

Add tests for Switch

This commit is contained in:
Aleksandr Gumroian
2020-08-18 17:37:08 +02:00
parent a0f7a312e5
commit f64419c643
2 changed files with 89 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
/*
* Copyright (C) 2020 CZ.NIC z.s.p.o. (http://www.nic.cz/)
*
* This is free software, licensed under the GNU General Public License v3.
* See /LICENSE for more information.
*/
import React from "react";
import { render } from "customTestRender";
import { Switch } from "../Switch";
describe("<Switch/>", () => {
it("Render switch", () => {
const { container } = render(
<Switch
label="Test label"
checked
helpText="Some help text"
onChange={() => {}}
/>
);
expect(container.firstChild).toMatchSnapshot();
});
it("Render uncheked switch", () => {
const { container } = render(
<Switch label="Test label" helpText="Some help text" />
);
expect(container.firstChild).toMatchSnapshot();
});
});