mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 07:25:44 +01:00
32 lines
661 B
JavaScript
32 lines
661 B
JavaScript
import React from "react";
|
|
import { configure, shallow } from "enzyme";
|
|
import EditUserButton from "./EditUserButton";
|
|
import Adapter from "enzyme-adapter-react-16";
|
|
|
|
import "raf/polyfill";
|
|
|
|
configure({ adapter: new Adapter() });
|
|
|
|
it("should render nothing, if the edit link is missing", () => {
|
|
const user = {
|
|
_links: {}
|
|
};
|
|
|
|
const button = shallow(<EditUserButton user={user} />);
|
|
expect(button.text()).toBe("");
|
|
});
|
|
|
|
it("should render the button", () => {
|
|
const user = {
|
|
_links: {
|
|
update: {
|
|
href: "/users"
|
|
}
|
|
}
|
|
};
|
|
|
|
const button = shallow(<EditUserButton user={user} />);
|
|
expect(button.text()).not.toBe("");
|
|
});
|
|
|