mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-03 14:21:49 +00:00
Refactored ServerError to infer error message based on provided server type guards
This commit is contained in:
@@ -1,16 +1,17 @@
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import { shallow, ShallowWrapper } from 'enzyme';
|
||||
import { Button } from 'reactstrap';
|
||||
import { Mock } from 'ts-mockery';
|
||||
import createErrorHandler from '../../src/common/ErrorHandler';
|
||||
|
||||
describe('<ErrorHandler />', () => {
|
||||
const window = {
|
||||
const window = Mock.of<Window>({
|
||||
location: {
|
||||
reload: jest.fn(),
|
||||
},
|
||||
};
|
||||
const console = { error: jest.fn() };
|
||||
let wrapper;
|
||||
});
|
||||
const console = Mock.of<Console>({ error: jest.fn() });
|
||||
let wrapper: ShallowWrapper;
|
||||
|
||||
beforeEach(() => {
|
||||
const ErrorHandler = createErrorHandler(window, console);
|
||||
Reference in New Issue
Block a user