Moved mercure hub binding from custom hook to HOC

This commit is contained in:
Alejandro Celaya
2020-09-06 19:41:15 +02:00
parent 536d49aac9
commit 5d6d802d64
11 changed files with 56 additions and 54 deletions

View File

@@ -5,6 +5,7 @@ import { faCaretDown as caretDownIcon, faCaretUp as caretUpIcon } from '@fortawe
import { Mock } from 'ts-mockery';
import shortUrlsListCreator, { ShortUrlsListProps, SORTABLE_FIELDS } from '../../src/short-urls/ShortUrlsList';
import { ShortUrl } from '../../src/short-urls/data';
import { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub';
describe('<ShortUrlsList />', () => {
let wrapper: ShallowWrapper;
@@ -18,6 +19,7 @@ describe('<ShortUrlsList />', () => {
wrapper = shallow(
<ShortUrlsList
{...Mock.all<ShortUrlsListProps>()}
{...Mock.of<MercureBoundProps>({ mercureInfo: { loading: true } })}
listShortUrls={listShortUrlsMock}
resetShortUrlParams={resetShortUrlParamsMock}
shortUrlsListParams={{
@@ -39,9 +41,8 @@ describe('<ShortUrlsList />', () => {
}),
]
}
mercureInfo={{ loading: true } as any}
/>,
);
).dive(); // Dive is needed as this component is wrapped in a HOC
});
afterEach(jest.resetAllMocks);