mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-17 18:51:10 +01:00
correct tests
This commit is contained in:
@@ -46,7 +46,6 @@ import reducer, {
|
|||||||
MODIFY_REPO,
|
MODIFY_REPO,
|
||||||
isModifyRepoPending,
|
isModifyRepoPending,
|
||||||
getModifyRepoFailure,
|
getModifyRepoFailure,
|
||||||
modifyRepoSuccess,
|
|
||||||
getPermissionsLink
|
getPermissionsLink
|
||||||
} from "./repos";
|
} from "./repos";
|
||||||
import type { Repository, RepositoryCollection } from "@scm-manager/ui-types";
|
import type { Repository, RepositoryCollection } from "@scm-manager/ui-types";
|
||||||
@@ -637,18 +636,6 @@ describe("repos reducer", () => {
|
|||||||
const newState = reducer({}, fetchRepoSuccess(slartiFjords));
|
const newState = reducer({}, fetchRepoSuccess(slartiFjords));
|
||||||
expect(newState.byNames["slarti/fjords"]).toBe(slartiFjords);
|
expect(newState.byNames["slarti/fjords"]).toBe(slartiFjords);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should update reposByNames", () => {
|
|
||||||
const oldState = {
|
|
||||||
byNames: {
|
|
||||||
"slarti/fjords": slartiFjords
|
|
||||||
}
|
|
||||||
};
|
|
||||||
let slartiFjordsEdited = { ...slartiFjords };
|
|
||||||
slartiFjordsEdited.description = "I bless the rains down in Africa";
|
|
||||||
const newState = reducer(oldState, modifyRepoSuccess(slartiFjordsEdited));
|
|
||||||
expect(newState.byNames["slarti/fjords"]).toEqual(slartiFjordsEdited);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("repos selectors", () => {
|
describe("repos selectors", () => {
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ import reducer, {
|
|||||||
MODIFY_USER_PENDING,
|
MODIFY_USER_PENDING,
|
||||||
MODIFY_USER_SUCCESS,
|
MODIFY_USER_SUCCESS,
|
||||||
modifyUser,
|
modifyUser,
|
||||||
modifyUserSuccess,
|
|
||||||
getUsersFromState,
|
getUsersFromState,
|
||||||
FETCH_USERS,
|
FETCH_USERS,
|
||||||
getFetchUsersFailure,
|
getFetchUsersFailure,
|
||||||
@@ -288,6 +287,7 @@ describe("users fetch()", () => {
|
|||||||
fetchMock.putOnce("http://localhost:8081/api/v2/users/zaphod", {
|
fetchMock.putOnce("http://localhost:8081/api/v2/users/zaphod", {
|
||||||
status: 204
|
status: 204
|
||||||
});
|
});
|
||||||
|
fetchMock.getOnce("http://localhost:8081/api/v2/users/zaphod", userZaphod);
|
||||||
|
|
||||||
let called = false;
|
let called = false;
|
||||||
const callMe = () => {
|
const callMe = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user