use new created error to fix test

This commit is contained in:
Maren Süwer
2018-12-10 08:11:09 +01:00
parent 6193c1edda
commit cc11f56bfa

View File

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