Fixed unit test

This commit is contained in:
Philipp Czora
2019-02-25 15:09:28 +01:00
parent a4d78e6e60
commit bbde074e19
3 changed files with 10 additions and 7 deletions

View File

@@ -43,7 +43,7 @@ export class NotFoundError extends BackendError {
export function createBackendError(content: BackendErrorContent, statusCode: number) {
switch (statusCode) {
case 403:
case 401:
return new UnauthorizedError(content, statusCode);
case 404:
return new NotFoundError(content, statusCode);

View File

@@ -688,10 +688,6 @@
react "^16.4.2"
react-dom "^16.4.2"
"@scm-manager/ui-types@2.0.0-SNAPSHOT":
version "2.0.0-20181010-130547"
resolved "https://registry.yarnpkg.com/@scm-manager/ui-types/-/ui-types-2.0.0-20181010-130547.tgz#9987b519e43d5c4b895327d012d3fd72429a7953"
"@types/node@*":
version "10.12.0"
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.0.tgz#ea6dcbddbc5b584c83f06c60e82736d8fbb0c235"

View File

@@ -180,8 +180,15 @@ describe("auth actions", () => {
it("should dispatch fetch me unauthorized", () => {
fetchMock.getOnce("/api/v2/me", {
status: 401
});
status: 401,
headers: {
"content-type": "application/vnd.scmm-error+json;v=2"
},
body: {
transactionId: "123",
message: "So nicht Freundchen",
context: {}
}});
const expectedActions = [
{ type: FETCH_ME_PENDING },