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