Pull in frontend

This commit is contained in:
Laszlo Fogas
2019-11-12 14:27:39 +01:00
parent e69106809b
commit 61a14df51b
153 changed files with 25134 additions and 4 deletions

View File

@@ -0,0 +1,32 @@
import React from "react";
import { mount } from "enzyme";
import Status from "../status";
import {
STATUS_FAILURE,
STATUS_RUNNING,
STATUS_SUCCESS,
} from "shared/constants/status";
jest.dontMock("../status");
describe("Status component", () => {
test("updates on status change", () => {
const status = mount(<Status status={STATUS_FAILURE} />);
const instance = status.instance();
expect(
instance.shouldComponentUpdate({ status: STATUS_FAILURE }),
).toBeFalsy();
expect(
instance.shouldComponentUpdate({ status: STATUS_SUCCESS }),
).toBeTruthy();
expect(status.hasClass("failure")).toBeTruthy();
});
test("uses the status as the class name", () => {
const status = mount(<Status status={STATUS_RUNNING} />);
expect(status.hasClass("running")).toBeTruthy();
});
});