mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 23:45:44 +01:00
add selectors for config content
This commit is contained in:
@@ -15,7 +15,9 @@ import reducer, {
|
||||
fetchConfigSuccess,
|
||||
getFetchConfigFailure,
|
||||
isFetchConfigPending,
|
||||
modifyConfig
|
||||
modifyConfig,
|
||||
getConfig,
|
||||
getConfigUpdatePermission
|
||||
} from "./config";
|
||||
|
||||
const CONFIG_URL = "/scm/api/rest/v2/config";
|
||||
@@ -197,4 +199,22 @@ describe("selector tests", () => {
|
||||
it("should return undefined when fetch config did not fail", () => {
|
||||
expect(getFetchConfigFailure({})).toBe(undefined);
|
||||
});
|
||||
|
||||
it("should return config", () => {
|
||||
const state = {
|
||||
config: {
|
||||
entries: config
|
||||
}
|
||||
};
|
||||
expect(getConfig(state)).toEqual(config);
|
||||
});
|
||||
|
||||
it("should return configUpdatePermission", () => {
|
||||
const state = {
|
||||
config: {
|
||||
configUpdatePermission: true
|
||||
}
|
||||
};
|
||||
expect(getConfigUpdatePermission(state)).toEqual(true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user