mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-05 04:55:50 +01:00
jest configuration for ui-packages
This commit is contained in:
@@ -12,7 +12,8 @@ import RepositoryConfig from "./RepositoryConfig";
|
||||
|
||||
// repository
|
||||
|
||||
const gitPredicate = (props: Object) => {
|
||||
// @visibleForTesting
|
||||
export const gitPredicate = (props: Object) => {
|
||||
return props.repository && props.repository.type === "git";
|
||||
};
|
||||
|
||||
|
||||
15
scm-plugins/scm-git-plugin/src/main/js/index.test.js
Normal file
15
scm-plugins/scm-git-plugin/src/main/js/index.test.js
Normal file
@@ -0,0 +1,15 @@
|
||||
// @flow
|
||||
import { gitPredicate } from "./index";
|
||||
|
||||
describe("test gi predicate", () => {
|
||||
it("should return false", () => {
|
||||
expect(gitPredicate()).toBe(false);
|
||||
expect(gitPredicate({})).toBe(false);
|
||||
expect(gitPredicate({ repository: {} })).toBe(false);
|
||||
expect(gitPredicate({ repository: { type: "hg" } })).toBe(false);
|
||||
});
|
||||
|
||||
it("should return true", () => {
|
||||
expect(gitPredicate({ repository: { type: "fir" } })).toBe(true);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user