mirror of
https://gitlab.nic.cz/turris/reforis/foris-js.git
synced 2024-11-14 17:35:35 +01:00
Fix tests
This commit is contained in:
parent
dfdaadeb65
commit
84097fa8e0
|
@ -9,7 +9,7 @@ import React from "react";
|
||||||
|
|
||||||
import { render } from "customTestRender";
|
import { render } from "customTestRender";
|
||||||
|
|
||||||
import { CheckBox } from "../CheckBox";
|
import CheckBox from "../CheckBox";
|
||||||
|
|
||||||
describe("<Checkbox/>", () => {
|
describe("<Checkbox/>", () => {
|
||||||
it("Render checkbox", () => {
|
it("Render checkbox", () => {
|
||||||
|
|
|
@ -9,7 +9,7 @@ import React from "react";
|
||||||
|
|
||||||
import { render } from "customTestRender";
|
import { render } from "customTestRender";
|
||||||
|
|
||||||
import { DownloadButton } from "../DownloadButton";
|
import DownloadButton from "../DownloadButton";
|
||||||
|
|
||||||
describe("<DownloadButton />", () => {
|
describe("<DownloadButton />", () => {
|
||||||
it("should have download attribute", () => {
|
it("should have download attribute", () => {
|
||||||
|
|
|
@ -9,7 +9,7 @@ import React from "react";
|
||||||
|
|
||||||
import { render, fireEvent, getByLabelText, wait } from "customTestRender";
|
import { render, fireEvent, getByLabelText, wait } from "customTestRender";
|
||||||
|
|
||||||
import { NumberInput } from "../NumberInput";
|
import NumberInput from "../NumberInput";
|
||||||
|
|
||||||
describe("<NumberInput/>", () => {
|
describe("<NumberInput/>", () => {
|
||||||
const onChangeMock = jest.fn();
|
const onChangeMock = jest.fn();
|
||||||
|
|
|
@ -9,7 +9,7 @@ import React from "react";
|
||||||
|
|
||||||
import { render } from "customTestRender";
|
import { render } from "customTestRender";
|
||||||
|
|
||||||
import { PasswordInput } from "../PasswordInput";
|
import PasswordInput from "../PasswordInput";
|
||||||
|
|
||||||
describe("<PasswordInput/>", () => {
|
describe("<PasswordInput/>", () => {
|
||||||
it("Render password input", () => {
|
it("Render password input", () => {
|
||||||
|
|
|
@ -9,7 +9,7 @@ import React from "react";
|
||||||
|
|
||||||
import { render } from "customTestRender";
|
import { render } from "customTestRender";
|
||||||
|
|
||||||
import { RadioSet } from "../RadioSet";
|
import RadioSet from "../RadioSet";
|
||||||
|
|
||||||
const TEST_CHOICES = [
|
const TEST_CHOICES = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,7 +14,7 @@ import {
|
||||||
render,
|
render,
|
||||||
} from "customTestRender";
|
} from "customTestRender";
|
||||||
|
|
||||||
import { Select } from "../Select";
|
import Select from "../Select";
|
||||||
|
|
||||||
const TEST_CHOICES = {
|
const TEST_CHOICES = {
|
||||||
1: "one",
|
1: "one",
|
||||||
|
|
|
@ -9,7 +9,7 @@ import React from "react";
|
||||||
|
|
||||||
import { render } from "customTestRender";
|
import { render } from "customTestRender";
|
||||||
|
|
||||||
import { Switch } from "../Switch";
|
import Switch from "../Switch";
|
||||||
|
|
||||||
describe("<Switch/>", () => {
|
describe("<Switch/>", () => {
|
||||||
it("Render switch", () => {
|
it("Render switch", () => {
|
||||||
|
|
|
@ -9,7 +9,7 @@ import React from "react";
|
||||||
|
|
||||||
import { render } from "customTestRender";
|
import { render } from "customTestRender";
|
||||||
|
|
||||||
import { TextInput } from "../TextInput";
|
import TextInput from "../TextInput";
|
||||||
|
|
||||||
describe("<TextInput/>", () => {
|
describe("<TextInput/>", () => {
|
||||||
it("Render text input", () => {
|
it("Render text input", () => {
|
||||||
|
|
|
@ -9,12 +9,12 @@ import React from "react";
|
||||||
import { render, fireEvent, wait } from "customTestRender";
|
import { render, fireEvent, wait } from "customTestRender";
|
||||||
|
|
||||||
import mockAxios from "jest-mock-axios";
|
import mockAxios from "jest-mock-axios";
|
||||||
import { WebSockets } from "webSockets/WebSockets";
|
import WebSockets from "webSockets/WebSockets";
|
||||||
import { mockJSONError } from "testUtils/network";
|
import { mockJSONError } from "testUtils/network";
|
||||||
import { mockSetAlert } from "testUtils/alertContextMock";
|
import { mockSetAlert } from "testUtils/alertContextMock";
|
||||||
import { ALERT_TYPES } from "../../../bootstrap/Alert";
|
import { ALERT_TYPES } from "../../../bootstrap/Alert";
|
||||||
|
|
||||||
import { ResetWiFiSettings } from "../ResetWiFiSettings";
|
import ResetWiFiSettings from "../ResetWiFiSettings";
|
||||||
|
|
||||||
describe("<ResetWiFiSettings/>", () => {
|
describe("<ResetWiFiSettings/>", () => {
|
||||||
const webSockets = new WebSockets();
|
const webSockets = new WebSockets();
|
||||||
|
|
|
@ -10,7 +10,7 @@ import diffSnapshot from "snapshot-diff";
|
||||||
import mockAxios from "jest-mock-axios";
|
import mockAxios from "jest-mock-axios";
|
||||||
|
|
||||||
import { fireEvent, render, wait } from "customTestRender";
|
import { fireEvent, render, wait } from "customTestRender";
|
||||||
import { WebSockets } from "webSockets/WebSockets";
|
import WebSockets from "webSockets/WebSockets";
|
||||||
import { mockJSONError } from "testUtils/network";
|
import { mockJSONError } from "testUtils/network";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
@ -19,7 +19,7 @@ import {
|
||||||
twoDevices,
|
twoDevices,
|
||||||
threeDevices,
|
threeDevices,
|
||||||
} from "./__fixtures__/wifiSettings";
|
} from "./__fixtures__/wifiSettings";
|
||||||
import { WiFiSettings, validator, byteCount } from "../WiFiSettings";
|
import WiFiSettings, { validator, byteCount } from "../WiFiSettings";
|
||||||
|
|
||||||
describe("<WiFiSettings/>", () => {
|
describe("<WiFiSettings/>", () => {
|
||||||
let firstRender;
|
let firstRender;
|
||||||
|
|
|
@ -18,7 +18,7 @@ import mockAxios from "jest-mock-axios";
|
||||||
import { mockJSONError } from "testUtils/network";
|
import { mockJSONError } from "testUtils/network";
|
||||||
import { mockSetAlert } from "testUtils/alertContextMock";
|
import { mockSetAlert } from "testUtils/alertContextMock";
|
||||||
|
|
||||||
import { RebootButton } from "../RebootButton";
|
import RebootButton from "../RebootButton";
|
||||||
|
|
||||||
describe("<RebootButton/>", () => {
|
describe("<RebootButton/>", () => {
|
||||||
let componentContainer;
|
let componentContainer;
|
||||||
|
|
|
@ -9,7 +9,7 @@ import React from "react";
|
||||||
|
|
||||||
import { act, fireEvent, render, waitForElement } from "customTestRender";
|
import { act, fireEvent, render, waitForElement } from "customTestRender";
|
||||||
import mockAxios from "jest-mock-axios";
|
import mockAxios from "jest-mock-axios";
|
||||||
import { WebSockets } from "webSockets/WebSockets";
|
import WebSockets from "webSockets/WebSockets";
|
||||||
import ForisForm from "../components/ForisForm";
|
import ForisForm from "../components/ForisForm";
|
||||||
|
|
||||||
// It's possible to unittest each hooks via react-hooks-testing-library.
|
// It's possible to unittest each hooks via react-hooks-testing-library.
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* See /LICENSE for more information.
|
* See /LICENSE for more information.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { toLocaleDateString } from "../datetime";
|
import toLocaleDateString from "../datetime";
|
||||||
|
|
||||||
describe("toLocaleDateString", () => {
|
describe("toLocaleDateString", () => {
|
||||||
it("should work with different locale", () => {
|
it("should work with different locale", () => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user