mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-01 21:26:46 +00:00
Added support to dispatch all UI actions based on mercure bindings on a specific schedule instead of real time
This commit is contained in:
@@ -20,7 +20,7 @@ describe('helpers', () => {
|
||||
[ Mock.of<MercureInfo>({ loading: false, error: false, mercureHubUrl: undefined }) ],
|
||||
[ Mock.of<MercureInfo>({ loading: true, error: true, mercureHubUrl: undefined }) ],
|
||||
])('does not bind an EventSource when loading, error or no hub URL', (mercureInfo) => {
|
||||
bindToMercureTopic(mercureInfo, '', identity, identity)();
|
||||
bindToMercureTopic(mercureInfo, '', identity, identity);
|
||||
|
||||
expect(EventSource).not.toHaveBeenCalled();
|
||||
expect(onMessage).not.toHaveBeenCalled();
|
||||
@@ -40,7 +40,7 @@ describe('helpers', () => {
|
||||
error: false,
|
||||
mercureHubUrl,
|
||||
token,
|
||||
}, topic, onMessage, onTokenExpired)();
|
||||
}, topic, onMessage, onTokenExpired);
|
||||
|
||||
expect(EventSource).toHaveBeenCalledWith(hubUrl, {
|
||||
headers: {
|
||||
|
||||
@@ -36,11 +36,11 @@ describe('mercureInfoReducer', () => {
|
||||
});
|
||||
|
||||
it('returns mercure info on GET_MERCURE_INFO', () => {
|
||||
expect(reducer(undefined, { type: GET_MERCURE_INFO, ...mercureInfo })).toEqual({
|
||||
expect(reducer(undefined, { type: GET_MERCURE_INFO, ...mercureInfo })).toEqual(expect.objectContaining({
|
||||
...mercureInfo,
|
||||
loading: false,
|
||||
error: false,
|
||||
});
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ describe('<TagsList />', () => {
|
||||
wrapper = shallow(
|
||||
<TagsListComp
|
||||
{...Mock.all<TagsListProps>()}
|
||||
{...Mock.all<MercureBoundProps>()}
|
||||
{...Mock.of<MercureBoundProps>({ mercureInfo: {} })}
|
||||
forceListTags={identity}
|
||||
filterTags={filterTags}
|
||||
tagsList={Mock.of<TagsList>(tagsList)}
|
||||
|
||||
@@ -26,7 +26,7 @@ describe('<ShortUrlVisits />', () => {
|
||||
wrapper = shallow(
|
||||
<ShortUrlVisits
|
||||
{...Mock.all<ShortUrlVisitsProps>()}
|
||||
{...Mock.all<MercureBoundProps>()}
|
||||
{...Mock.of<MercureBoundProps>({ mercureInfo: {} })}
|
||||
getShortUrlDetail={identity}
|
||||
getShortUrlVisits={getShortUrlVisitsMock}
|
||||
match={match}
|
||||
|
||||
@@ -26,7 +26,7 @@ describe('<TagVisits />', () => {
|
||||
wrapper = shallow(
|
||||
<TagVisits
|
||||
{...Mock.all<TagVisitsProps>()}
|
||||
{...Mock.all<MercureBoundProps>()}
|
||||
{...Mock.of<MercureBoundProps>({ mercureInfo: {} })}
|
||||
getTagVisits={getTagVisitsMock}
|
||||
match={match}
|
||||
history={history}
|
||||
|
||||
Reference in New Issue
Block a user