mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-06 21:45:43 +01:00
Fixed test & removed unused code
This commit is contained in:
@@ -111,15 +111,7 @@ function extractChangesetsByIds(data: any, oldChangesetsByIds: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//selectors
|
//selectors
|
||||||
export function getChangesetsForNamespaceAndNameFromState(namespace: string, name: string, state: Object) {
|
export function getChangesets(state: Object, namespace: string, name: string, branch?: string) {
|
||||||
const key = createItemId(namespace, name);
|
|
||||||
if (!state.changesets[key]) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return Object.values(state.changesets[key].byId);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getChangesets(state: Object, namespace: string, name: string, branch: string) {
|
|
||||||
const key = createItemId(namespace, name, branch);
|
const key = createItemId(namespace, name, branch);
|
||||||
if (!state.changesets[key]) {
|
if (!state.changesets[key]) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import {
|
|||||||
fetchChangesetsByNamespaceNameAndBranch,
|
fetchChangesetsByNamespaceNameAndBranch,
|
||||||
fetchChangesetsSuccess,
|
fetchChangesetsSuccess,
|
||||||
getChangesets,
|
getChangesets,
|
||||||
getChangesetsForNamespaceAndNameFromState,
|
|
||||||
getFetchChangesetsFailure,
|
getFetchChangesetsFailure,
|
||||||
isFetchChangesetsPending
|
isFetchChangesetsPending
|
||||||
} from "./changesets";
|
} from "./changesets";
|
||||||
@@ -186,8 +185,7 @@ describe("changesets", () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// const result = getChangesetsForNamespaceAndNameFromState("foo", "bar", state);
|
const result = getChangesets(state, "foo", "bar" );
|
||||||
const result = getChangesets("foo", "bar", "", state);
|
|
||||||
expect(result).toContainEqual({id: "id1"})
|
expect(result).toContainEqual({id: "id1"})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user