Fixed issues preventing paged changeset list to be accessed via URL

This commit is contained in:
Philipp Czora
2018-10-08 12:54:11 +02:00
parent 7036291874
commit e58269444b
5 changed files with 64 additions and 54 deletions

View File

@@ -2,13 +2,15 @@ import configureMockStore from "redux-mock-store";
import thunk from "redux-thunk";
import fetchMock from "fetch-mock";
import reducer, {
FETCH_BRANCHES,
FETCH_BRANCHES_FAILURE,
FETCH_BRANCHES_PENDING,
FETCH_BRANCHES_SUCCESS,
fetchBranches,
getBranch,
getBranches,
getBranchNames
getBranchNames,
isFetchBranchesPending
} from "./branches";
const namespace = "foo";
@@ -138,6 +140,16 @@ describe("branches", () => {
}
};
it("should return true, when fetching branches is pending", () => {
const state = {
pending: {
[FETCH_BRANCHES + "/foo/bar"]: true
}
};
expect(isFetchBranchesPending(state, repository)).toBeTruthy();
});
it("should return branches names", () => {
const names = getBranchNames(state, repository);
expect(names.length).toEqual(2);