Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Commit

Permalink
!fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
Haroenv committed Nov 20, 2019
1 parent cf5dbf5 commit 503ed98
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions __mocks__/instantsearch-es.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ const fakeInstantSearch = jest.fn(
start: jest.fn(() => {
instantsearchInstance.started = true;
}),
dispose: jest.fn(),
dispose: jest.fn(() => {
instantsearchInstance.started = false;
}),
mainIndex: {
$$type: 'ais.index',
_widgets: [],
Expand All @@ -48,15 +50,15 @@ const fakeInstantSearch = jest.fn(
},
},
addWidgets(widgets) {
this.mainIndex._widgets = this.mainIndex._widgets.concat(widgets);
instantsearchInstance.mainIndex._widgets.push(...widgets);
},
removeWidgets(widgets) {
widgets.forEach(widget => {
const i = this.mainIndex._widgets.findIndex(widget);
const i = instantsearchInstance.mainIndex._widgets.findIndex(widget);
if (i === -1) {
return;
}
this.mainIndex._widgets.splice(i, 1);
instantsearchInstance.mainIndex._widgets.splice(i, 1);
});
},
};
Expand Down

0 comments on commit 503ed98

Please sign in to comment.