Fixed unit test

This commit is contained in:
philipp
2018-11-21 11:12:47 +01:00
parent e7caa59170
commit b4c313862e
3 changed files with 10 additions and 7 deletions

View File

@@ -2,7 +2,10 @@
import type { Me } from "@scm-manager/ui-types";
import * as types from "./types";
import { apiClient, UNAUTHORIZED_ERROR } from "@scm-manager/ui-components";
import {
apiClient,
UNAUTHORIZED_ERROR_MESSAGE
} from "@scm-manager/ui-components";
import { isPending } from "./pending";
import { getFailure } from "./failure";
import {
@@ -187,7 +190,7 @@ export const fetchMe = (link: string) => {
dispatch(fetchMeSuccess(me));
})
.catch((error: Error) => {
if (error === UNAUTHORIZED_ERROR) {
if (error.message === UNAUTHORIZED_ERROR_MESSAGE) {
dispatch(fetchMeUnauthenticated());
} else {
dispatch(fetchMeFailure(error));