diff --git a/src/highlight/__mocks__/data.ts b/src/highlight/__mocks__/data.ts index 4159a323e..1c123bd57 100644 --- a/src/highlight/__mocks__/data.ts +++ b/src/highlight/__mocks__/data.ts @@ -72,7 +72,7 @@ export const selection = { ], }; -export const ref = { +export const canvasContext = { fillRect: jest.fn(), restore: jest.fn(), save: jest.fn(), diff --git a/src/highlight/__tests__/HighlightCanvas-test.tsx b/src/highlight/__tests__/HighlightCanvas-test.tsx index 6f0305fdf..d43cb8d6c 100644 --- a/src/highlight/__tests__/HighlightCanvas-test.tsx +++ b/src/highlight/__tests__/HighlightCanvas-test.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { shallow, ShallowWrapper } from 'enzyme'; import HighlightCanvas, { Props } from '../HighlightCanvas'; -import { rect as mockRect, ref, noWidthRect, noHeightRect } from '../__mocks__/data'; +import { canvasContext, rect as mockRect, noWidthRect, noHeightRect } from '../__mocks__/data'; describe('HighlightCanvas', () => { const defaults: Props = { @@ -64,14 +64,14 @@ describe('HighlightCanvas', () => { current: { // eslint-disable-next-line @typescript-eslint/ban-ts-ignore // @ts-ignore - getContext: () => ref, + getContext: () => canvasContext, }, }; instance.renderRects(); - expect(ref.fillRect).toHaveBeenCalledTimes(1); - expect(ref.strokeRect).toHaveBeenCalledTimes(1); + expect(canvasContext.fillRect).toHaveBeenCalledTimes(1); + expect(canvasContext.strokeRect).toHaveBeenCalledTimes(1); }); }); });