Fixed TS errors in tests

This commit is contained in:
Alejandro Celaya 2021-08-24 20:26:57 +02:00
parent 06f4cff97e
commit d1fcd10c04
2 changed files with 3 additions and 3 deletions

View file

@ -1,7 +1,7 @@
import { shallow, ShallowWrapper } from 'enzyme'; import { shallow, ShallowWrapper } from 'enzyme';
import { Mock } from 'ts-mockery'; import { Mock } from 'ts-mockery';
import asideMenuCreator from '../../src/common/AsideMenu'; import asideMenuCreator from '../../src/common/AsideMenu';
import { ServerWithId } from '../../src/servers/data'; import { ReachableServer } from '../../src/servers/data';
describe('<AsideMenu />', () => { describe('<AsideMenu />', () => {
let wrapped: ShallowWrapper; let wrapped: ShallowWrapper;
@ -10,7 +10,7 @@ describe('<AsideMenu />', () => {
beforeEach(() => { beforeEach(() => {
const AsideMenu = asideMenuCreator(DeleteServerButton); const AsideMenu = asideMenuCreator(DeleteServerButton);
wrapped = shallow(<AsideMenu selectedServer={Mock.of<ServerWithId>({ id: 'abc123' })} />); wrapped = shallow(<AsideMenu selectedServer={Mock.of<ReachableServer>({ id: 'abc123' })} />);
}); });
afterEach(() => wrapped.unmount()); afterEach(() => wrapped.unmount());

View file

@ -11,7 +11,7 @@ import { SemVer } from '../../src/utils/helpers/version';
describe('<MenuLayout />', () => { describe('<MenuLayout />', () => {
const ServerError = jest.fn(); const ServerError = jest.fn();
const C = jest.fn(); const C = jest.fn();
const MenuLayout = createMenuLayout(C, C, C, C, C, C, C, ServerError, C, C); const MenuLayout = createMenuLayout(C, C, C, C, C, C, C, ServerError, C, C, C);
let wrapper: ShallowWrapper; let wrapper: ShallowWrapper;
const createWrapper = (selectedServer: SelectedServer) => { const createWrapper = (selectedServer: SelectedServer) => {
wrapper = shallow( wrapper = shallow(