mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-16 18:26:16 +01:00
Fixed unit tests
This commit is contained in:
@@ -29,7 +29,7 @@ describe("DeletePermissionButton", () => {
|
|||||||
expect(navLink.text()).toBe("");
|
expect(navLink.text()).toBe("");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should render the navLink", () => {
|
it("should render the delete icon", () => {
|
||||||
const permission = {
|
const permission = {
|
||||||
_links: {
|
_links: {
|
||||||
delete: {
|
delete: {
|
||||||
@@ -38,14 +38,14 @@ describe("DeletePermissionButton", () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const navLink = mount(
|
const deleteIcon = mount(
|
||||||
<DeletePermissionButton
|
<DeletePermissionButton
|
||||||
permission={permission}
|
permission={permission}
|
||||||
deletePermission={() => {}}
|
deletePermission={() => {}}
|
||||||
/>,
|
/>,
|
||||||
options.get()
|
options.get()
|
||||||
);
|
);
|
||||||
expect(navLink.text()).not.toBe("");
|
expect(deleteIcon.html()).not.toBe("");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should open the confirm dialog on button click", () => {
|
it("should open the confirm dialog on button click", () => {
|
||||||
@@ -64,7 +64,7 @@ describe("DeletePermissionButton", () => {
|
|||||||
/>,
|
/>,
|
||||||
options.get()
|
options.get()
|
||||||
);
|
);
|
||||||
button.find("button").simulate("click");
|
button.find(".fa-trash").simulate("click");
|
||||||
|
|
||||||
expect(confirmAlert.mock.calls.length).toBe(1);
|
expect(confirmAlert.mock.calls.length).toBe(1);
|
||||||
});
|
});
|
||||||
@@ -91,7 +91,7 @@ describe("DeletePermissionButton", () => {
|
|||||||
/>,
|
/>,
|
||||||
options.get()
|
options.get()
|
||||||
);
|
);
|
||||||
button.find("button").simulate("click");
|
button.find(".fa-trash").simulate("click");
|
||||||
|
|
||||||
expect(calledUrl).toBe("/permission");
|
expect(calledUrl).toBe("/permission");
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user