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
|
||||
export function getChangesetsForNamespaceAndNameFromState(namespace: string, name: string, state: Object) {
|
||||
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) {
|
||||
export function getChangesets(state: Object, namespace: string, name: string, branch?: string) {
|
||||
const key = createItemId(namespace, name, branch);
|
||||
if (!state.changesets[key]) {
|
||||
return null;
|
||||
|
||||
@@ -12,7 +12,6 @@ import {
|
||||
fetchChangesetsByNamespaceNameAndBranch,
|
||||
fetchChangesetsSuccess,
|
||||
getChangesets,
|
||||
getChangesetsForNamespaceAndNameFromState,
|
||||
getFetchChangesetsFailure,
|
||||
isFetchChangesetsPending
|
||||
} from "./changesets";
|
||||
@@ -186,8 +185,7 @@ describe("changesets", () => {
|
||||
}
|
||||
}
|
||||
};
|
||||
// const result = getChangesetsForNamespaceAndNameFromState("foo", "bar", state);
|
||||
const result = getChangesets("foo", "bar", "", state);
|
||||
const result = getChangesets(state, "foo", "bar" );
|
||||
expect(result).toContainEqual({id: "id1"})
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user