mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-03 12:05:52 +01:00
fix tests for core plugins
This commit is contained in:
@@ -14,7 +14,7 @@ import RepositoryConfig from "./RepositoryConfig";
|
||||
|
||||
// @visibleForTesting
|
||||
export const gitPredicate = (props: Object) => {
|
||||
return props.repository && props.repository.type === "git";
|
||||
return !!(props && props.repository && props.repository.type === "git");
|
||||
};
|
||||
|
||||
binder.bind(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// @flow
|
||||
import { gitPredicate } from "./index";
|
||||
|
||||
describe("test gi predicate", () => {
|
||||
describe("test git predicate", () => {
|
||||
it("should return false", () => {
|
||||
expect(gitPredicate()).toBe(false);
|
||||
expect(gitPredicate({})).toBe(false);
|
||||
@@ -10,6 +10,6 @@ describe("test gi predicate", () => {
|
||||
});
|
||||
|
||||
it("should return true", () => {
|
||||
expect(gitPredicate({ repository: { type: "fir" } })).toBe(true);
|
||||
expect(gitPredicate({ repository: { type: "git" } })).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user