Skip to content

Commit

Permalink
test(link-ext): Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoSven committed Jul 7, 2022
1 parent 44cfec0 commit b71ea89
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions packages/remirror__extension-link/__tests__/link-extension.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -625,10 +625,12 @@ describe('autolinking', () => {
});

it('calls the onUpdateLink handler when auto linking', () => {
jest.spyOn(window, 'requestAnimationFrame').mockImplementation((requestCallback) => {
requestCallback(1);
return 1;
});
jest
.spyOn(window, 'requestAnimationFrame')
.mockImplementation((requestCallback: FrameRequestCallback) => {
requestCallback(1);
return 1;
});
let editorText = 'test.co';
editor.add(doc(p('<cursor>'))).insertText(editorText);

Expand Down Expand Up @@ -783,6 +785,12 @@ describe('autolinking', () => {
});

it('should only update first link', () => {
jest
.spyOn(window, 'requestAnimationFrame')
.mockImplementation((requestCallback: FrameRequestCallback) => {
requestCallback(1);
return 1;
});
editor.add(
doc(
p(
Expand All @@ -809,6 +817,12 @@ describe('autolinking', () => {
});

it('should update first link once after stepping out of link node', () => {
jest
.spyOn(window, 'requestAnimationFrame')
.mockImplementation((requestCallback: FrameRequestCallback) => {
requestCallback(1);
return 1;
});
editor.add(
doc(
p(
Expand Down

0 comments on commit b71ea89

Please sign in to comment.