fetch indexResources at beginning

This commit is contained in:
Maren Süwer
2018-10-05 13:14:33 +02:00
parent 3fd88f6166
commit a5f4d9713e
3 changed files with 31 additions and 6 deletions

View File

@@ -19,7 +19,8 @@ import reducer, {
getRepositoriesLink,
getHgConfigLink,
getGitConfigLink,
getSvnConfigLink
getSvnConfigLink,
getLinks
} from "./indexResource";
const indexResourcesUnauthenticated = {
@@ -187,6 +188,15 @@ describe("index resources selectors", () => {
expect(getFetchIndexResourcesFailure({})).toBe(undefined);
});
it("should return all links", () => {
const state = {
indexResources: {
links: indexResourcesAuthenticated._links
}
};
expect(getLinks(state)).toBe(indexResourcesAuthenticated._links);
});
// ui plugins link
it("should return ui plugins link when authenticated and has permission to see it", () => {
const state = {