Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
fix: correct tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Raspincel committed Jan 17, 2024
1 parent 9bf2772 commit 6e9151d
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/components/comments/html-pin-adapter/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,23 @@ describe('HTMLPinAdapter', () => {
const removeSpy = jest.fn();
const removeEventListenerSpy = jest.fn();

const getAttribute = jest
.fn()
.mockResolvedValue(Math.random() > 0.5 ? '' : 'data-wrapper-type');
const parentElement = {
remove: removeSpy,
};

const wrappers = [...instance['divWrappers']].map(([entry, value]) => {
return [
entry,
{ ...value, remove: removeSpy, removeEventListener: removeEventListenerSpy },
{
...value,
remove: removeSpy,
removeEventListener: removeEventListenerSpy,
getAttribute,
parentElement,
},
];
});
instance['divWrappers'] = new Map(wrappers as [key: any, value: any][]);
Expand Down

0 comments on commit 6e9151d

Please sign in to comment.