mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
update tests
This commit is contained in:
@@ -62,7 +62,7 @@ export function fetchPermissionsPending(
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function fetchPermissionsSuccess(
|
export function fetchPermissionsSuccess(
|
||||||
permissions: PermissionCollection,
|
permissions: any,
|
||||||
namespace: string,
|
namespace: string,
|
||||||
name: string
|
name: string
|
||||||
): Action {
|
): Action {
|
||||||
|
|||||||
@@ -66,6 +66,12 @@ const hitchhiker_puzzle42Permissions: PermissionCollection = [
|
|||||||
hitchhiker_puzzle42Permission_user_zwei
|
hitchhiker_puzzle42Permission_user_zwei
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const hitchhiker_puzzle42RepoPermissions = {
|
||||||
|
_embedded: {
|
||||||
|
permissions: hitchhiker_puzzle42Permissions
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
describe("permission fetch", () => {
|
describe("permission fetch", () => {
|
||||||
const REPOS_URL = "/scm/api/rest/v2/repositories";
|
const REPOS_URL = "/scm/api/rest/v2/repositories";
|
||||||
const mockStore = configureMockStore([thunk]);
|
const mockStore = configureMockStore([thunk]);
|
||||||
@@ -78,7 +84,7 @@ describe("permission fetch", () => {
|
|||||||
it("should successfully fetch permissions to repo hitchhiker/puzzle42", () => {
|
it("should successfully fetch permissions to repo hitchhiker/puzzle42", () => {
|
||||||
fetchMock.getOnce(
|
fetchMock.getOnce(
|
||||||
REPOS_URL + "/hitchhiker/puzzle42/permissions",
|
REPOS_URL + "/hitchhiker/puzzle42/permissions",
|
||||||
hitchhiker_puzzle42Permissions
|
hitchhiker_puzzle42RepoPermissions
|
||||||
);
|
);
|
||||||
|
|
||||||
const expectedActions = [
|
const expectedActions = [
|
||||||
@@ -92,7 +98,7 @@ describe("permission fetch", () => {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: FETCH_PERMISSIONS_SUCCESS,
|
type: FETCH_PERMISSIONS_SUCCESS,
|
||||||
payload: hitchhiker_puzzle42Permissions,
|
payload: hitchhiker_puzzle42RepoPermissions,
|
||||||
itemId: "hitchhiker/puzzle42"
|
itemId: "hitchhiker/puzzle42"
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
@@ -216,7 +222,7 @@ describe("permissions reducer", () => {
|
|||||||
const newState = reducer(
|
const newState = reducer(
|
||||||
{},
|
{},
|
||||||
fetchPermissionsSuccess(
|
fetchPermissionsSuccess(
|
||||||
hitchhiker_puzzle42Permissions,
|
hitchhiker_puzzle42RepoPermissions,
|
||||||
"hitchhiker",
|
"hitchhiker",
|
||||||
"puzzle42"
|
"puzzle42"
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user