mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 23:45:44 +01:00
Added missing files
hg did not show them as added
This commit is contained in:
31
scm-ui/src/users/containers/EditUserButton.test.js
Normal file
31
scm-ui/src/users/containers/EditUserButton.test.js
Normal file
@@ -0,0 +1,31 @@
|
||||
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("");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user