From c03202d9a48baf46fe0a3e97ac6449170cded26b Mon Sep 17 00:00:00 2001 From: Wojciech Maj Date: Fri, 20 May 2022 12:32:49 +0200 Subject: [PATCH] Replace Enzyme with React Testing Library (#1003) --- jest.config.json | 2 +- jest.setup.js | 4 - package.json | 4 +- src/Document.spec.jsx | 224 +++++----- src/Outline.spec.jsx | 29 +- src/OutlineItem.spec.jsx | 20 +- src/Page.spec.jsx | 339 ++++++-------- src/Page/AnnotationLayer.spec.jsx | 67 ++- src/Page/PageCanvas.spec.jsx | 8 +- src/Page/PageSVG.spec.jsx | 6 +- src/Page/TextLayer.spec.jsx | 26 +- yarn.lock | 707 +++++++++++------------------- 12 files changed, 561 insertions(+), 875 deletions(-) delete mode 100644 jest.setup.js diff --git a/jest.config.json b/jest.config.json index 2f5066a65..12921327b 100644 --- a/jest.config.json +++ b/jest.config.json @@ -9,6 +9,6 @@ "\\.(css|less)$": "/__mocks__/styleMock.js", "pdfjs-dist/(.*)": "pdfjs-dist/legacy/$1" }, - "setupFiles": ["jest-canvas-mock", "/jest.setup.js"], + "setupFilesAfterEnv": ["jest-canvas-mock", "@testing-library/jest-dom"], "testEnvironment": "/jest.env.js" } diff --git a/jest.setup.js b/jest.setup.js deleted file mode 100644 index 1d262ca55..000000000 --- a/jest.setup.js +++ /dev/null @@ -1,4 +0,0 @@ -import Enzyme from 'enzyme'; -import Adapter from '@wojtekmaj/enzyme-adapter-react-17'; - -Enzyme.configure({ adapter: new Adapter() }); diff --git a/package.json b/package.json index 99693c49c..a9379952a 100644 --- a/package.json +++ b/package.json @@ -88,8 +88,8 @@ "@babel/plugin-transform-runtime": "^7.15.0", "@babel/preset-env": "^7.15.0", "@babel/preset-react": "^7.14.0", - "@wojtekmaj/enzyme-adapter-react-17": "^0.6.0", - "enzyme": "^3.10.0", + "@testing-library/jest-dom": "^5.15.0", + "@testing-library/react": "^12.1.0", "eslint": "^8.5.0", "eslint-config-wojtekmaj": "^0.6.5", "husky": "^7.0.0", diff --git a/src/Document.spec.jsx b/src/Document.spec.jsx index 2969e7e6d..305b00e2e 100644 --- a/src/Document.spec.jsx +++ b/src/Document.spec.jsx @@ -1,9 +1,10 @@ -import React from 'react'; -import { mount, shallow } from 'enzyme'; +import React, { createRef } from 'react'; +import { fireEvent, getByTestId, render } from '@testing-library/react'; import { pdfjs } from './entry.jest'; import Document from './Document'; +import DocumentContext from './DocumentContext'; import { makeAsyncCallback, loadPDF, muteConsole, restoreConsole } from '../test-utils'; @@ -12,7 +13,18 @@ const pdfFile2 = loadPDF('./__mocks__/_pdf2.pdf'); const OK = Symbol('OK'); -const Child = () =>
; +// eslint-disable-next-line react/prop-types +function ChildInternal({ renderMode, rotate }) { + return
; +} + +function Child(props) { + return ( + + {(context) => } + + ); +} describe('Document', () => { // Object with basic loaded PDF information that shall match after successful loading @@ -32,7 +44,7 @@ describe('Document', () => { const { func: onSourceSuccess, promise: onSourceSuccessPromise } = makeAsyncCallback(OK); const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - shallow( + render( { const { func: onSourceSuccess, promise: onSourceSuccessPromise } = makeAsyncCallback(OK); const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - shallow( + render( { const { func: onSourceSuccess, promise: onSourceSuccessPromise } = makeAsyncCallback(OK); const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - shallow( + render( { const { func: onSourceSuccess, promise: onSourceSuccessPromise } = makeAsyncCallback(OK); const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - shallow( + render( { const { func: onSourceSuccess, promise: onSourceSuccessPromise } = makeAsyncCallback(OK); const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - shallow( + render( { muteConsole(); - shallow( null} onSourceError={onSourceError} />); + render( null} onSourceError={onSourceError} />); expect.assertions(1); @@ -133,7 +145,7 @@ describe('Document', () => { const { func: onSourceSuccess, promise: onSourceSuccessPromise } = makeAsyncCallback(OK); const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - const mountedComponent = shallow( + const { rerender } = render( { const { func: onSourceSuccess2, promise: onSourceSuccessPromise2 } = makeAsyncCallback(OK); const { func: onLoadSuccess2, promise: onLoadSuccessPromise2 } = makeAsyncCallback(); - mountedComponent.setProps({ - file: pdfFile2.file, - onLoadSuccess: onLoadSuccess2, - onSourceSuccess: onSourceSuccess2, - }); + rerender( + , + ); await expect(onSourceSuccessPromise2).resolves.toBe(OK); await expect(onLoadSuccessPromise2).resolves.toMatchObject(desiredLoadedPdf2); @@ -164,105 +178,74 @@ describe('Document', () => { it('applies className to its wrapper when given a string', () => { const className = 'testClassName'; - const component = shallow(); + const { container } = render(); - const wrapperClassName = component.find('.react-pdf__Document').prop('className'); + const wrapper = container.querySelector('.react-pdf__Document'); - expect(wrapperClassName.includes(className)).toBe(true); + expect(wrapper).toHaveClass(className); }); it('passes container element to inputRef properly', () => { const inputRef = jest.fn(); - mount(); + render(); expect(inputRef).toHaveBeenCalled(); expect(inputRef.mock.calls[0][0]).toBeInstanceOf(HTMLElement); }); it('renders "No PDF file specified." when given nothing', () => { - const component = shallow(); + const { container } = render(); - const noData = component.find('Message'); + const noData = container.querySelector('.react-pdf__message'); - expect(noData).toHaveLength(1); - expect(noData.prop('children')).toBe('No PDF file specified.'); + expect(noData).toBeInTheDocument(); + expect(noData).toHaveTextContent('No PDF file specified.'); }); it('renders custom no data message when given nothing and noData prop is given', () => { - const component = shallow(); + const { container } = render(); - const noData = component.find('Message'); + const noData = container.querySelector('.react-pdf__message'); - expect(noData).toHaveLength(1); - expect(noData.prop('children')).toBe('Nothing here'); + expect(noData).toBeInTheDocument(); + expect(noData).toHaveTextContent('Nothing here'); }); it('renders custom no data message when given nothing and noData prop is given as a function', () => { - const component = shallow( 'Nothing here'} />); + const { container } = render( 'Nothing here'} />); - const noData = component.find('Message'); + const noData = container.querySelector('.react-pdf__message'); - expect(noData).toHaveLength(1); - expect(noData.prop('children')).toBe('Nothing here'); + expect(noData).toBeInTheDocument(); + expect(noData).toHaveTextContent('Nothing here'); }); it('renders "Loading PDF…" when loading a file', async () => { - const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - - const component = shallow(); - - expect.assertions(2); + const { container } = render(); - await onLoadSuccessPromise; - - // Since the pdf loads automatically, we need to simulate its loading state - component.setState({ pdf: null }); - - const loading = component.find('Message'); + const loading = container.querySelector('.react-pdf__message'); - expect(loading).toHaveLength(1); - expect(loading.prop('children')).toBe('Loading PDF…'); + expect(loading).toBeInTheDocument(); + expect(loading).toHaveTextContent('Loading PDF…'); }); it('renders custom loading message when loading a file and loading prop is given', async () => { - const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - - const component = shallow( - , - ); - - expect.assertions(2); - - await onLoadSuccessPromise; + const { container } = render(); - // Since the pdf loads automatically, we need to simulate its loading state - component.setState({ pdf: null }); + const loading = container.querySelector('.react-pdf__message'); - const loading = component.find('Message'); - - expect(loading).toHaveLength(1); - expect(loading.prop('children')).toBe('Loading'); + expect(loading).toBeInTheDocument(); + expect(loading).toHaveTextContent('Loading'); }); it('renders custom loading message when loading a file and loading prop is given as a function', async () => { - const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - - const component = shallow( - 'Loading'} onLoadSuccess={onLoadSuccess} />, - ); - - expect.assertions(2); - - await onLoadSuccessPromise; + const { container } = render( 'Loading'} />); - // Since the pdf loads automatically, we need to simulate its loading state - component.setState({ pdf: null }); + const loading = container.querySelector('.react-pdf__message'); - const loading = component.find('Message'); - - expect(loading).toHaveLength(1); - expect(loading.prop('children')).toBe('Loading'); + expect(loading).toBeInTheDocument(); + expect(loading).toHaveTextContent('Loading'); }); it('renders "Failed to load PDF file." when failed to load a document', async () => { @@ -271,17 +254,16 @@ describe('Document', () => { muteConsole(); - const component = shallow(); + const { container } = render(); expect.assertions(2); await onLoadErrorPromise; - component.update(); - const error = component.find('Message'); + const error = container.querySelector('.react-pdf__message'); - expect(error).toHaveLength(1); - expect(error.prop('children')).toBe('Failed to load PDF file.'); + expect(error).toBeInTheDocument(); + expect(error).toHaveTextContent('Failed to load PDF file.'); restoreConsole(); }); @@ -292,7 +274,7 @@ describe('Document', () => { muteConsole(); - const component = shallow( + const { container } = render( , ); @@ -300,12 +282,10 @@ describe('Document', () => { await onLoadErrorPromise; - component.update(); - - const error = component.find('Message'); + const error = container.querySelector('.react-pdf__message'); - expect(error).toHaveLength(1); - expect(error.prop('children')).toBe('Error'); + expect(error).toBeInTheDocument(); + expect(error).toHaveTextContent('Error'); restoreConsole(); }); @@ -313,7 +293,7 @@ describe('Document', () => { it('passes renderMode prop to its children', async () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - const component = shallow( + const { container } = render( { await onLoadSuccessPromise; - component.update(); - - expect(component.instance().childContext.renderMode).toBe('svg'); + const child = getByTestId(container, 'child'); + expect(child.dataset.rendermode).toBe('svg'); }); it('passes rotate prop to its children', async () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - const component = shallow( + const { container } = render( , @@ -346,15 +325,14 @@ describe('Document', () => { await onLoadSuccessPromise; - component.update(); - - expect(component.instance().childContext.rotate).toBe(90); + const child = getByTestId(container, 'child'); + expect(child.dataset.rotate).toBe('90'); }); it('does not overwrite renderMode prop in its children when given renderMode prop to both Document and its children', async () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - const component = shallow( + const { container } = render( { await onLoadSuccessPromise; - component.update(); - - const child = component.find('Child'); - expect(child.prop('renderMode')).toBe('canvas'); + const child = getByTestId(container, 'child'); + expect(child.dataset.rendermode).toBe('canvas'); }); it('does not overwrite rotate prop in its children when given rotate prop to both Document and its children', async () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - const component = shallow( + const { container } = render( , @@ -388,10 +364,8 @@ describe('Document', () => { await onLoadSuccessPromise; - component.update(); - - const child = component.find('Child'); - expect(child.prop('rotate')).toBe(180); + const child = getByTestId(container, 'child'); + expect(child.dataset.rotate).toBe('180'); }); }); @@ -400,9 +374,15 @@ describe('Document', () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); const onItemClick = jest.fn(); + const instance = createRef(); - const component = shallow( - , + render( + , ); expect.assertions(2); @@ -414,7 +394,7 @@ describe('Document', () => { const pageNumber = 6; // Simulate clicking on an outline item - component.instance().viewer.scrollPageIntoView({ dest, pageIndex, pageNumber }); + instance.current.viewer.scrollPageIntoView({ dest, pageIndex, pageNumber }); expect(onItemClick).toHaveBeenCalledTimes(1); expect(onItemClick).toHaveBeenCalledWith({ dest, pageIndex, pageNumber }); @@ -422,8 +402,9 @@ describe('Document', () => { it('attempts to find a page and scroll it into view if onItemClick is not given', async () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); + const instance = createRef(); - const component = shallow(); + render(); expect.assertions(1); @@ -436,10 +417,10 @@ describe('Document', () => { const pageNumber = 6; // Register fake page in Document viewer - component.instance().pages[pageIndex] = { scrollIntoView }; + instance.current.pages[pageIndex] = { scrollIntoView }; // Simulate clicking on an outline item - component.instance().viewer.scrollPageIntoView({ dest, pageIndex, pageNumber }); + instance.current.viewer.scrollPageIntoView({ dest, pageIndex, pageNumber }); expect(scrollIntoView).toHaveBeenCalledTimes(1); }); @@ -458,11 +439,14 @@ describe('Document', () => { async ({ externalLinkTarget, target }) => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - const component = shallow( + const instance = createRef(); + + render( , ); @@ -470,7 +454,7 @@ describe('Document', () => { await onLoadSuccessPromise; - expect(component.instance().linkService.externalLinkTarget).toBe(target); + expect(instance.current.linkService.externalLinkTarget).toBe(target); }, ); }); @@ -486,12 +470,14 @@ describe('Document', () => { 'returns externalLinkRel = $rel given externalLinkRel prop = $externalLinkRel', async ({ externalLinkRel, rel }) => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); + const instance = createRef(); - const component = shallow( + render( , ); @@ -499,17 +485,17 @@ describe('Document', () => { await onLoadSuccessPromise; - expect(component.instance().linkService.externalLinkRel).toBe(rel); + expect(instance.current.linkService.externalLinkRel).toBe(rel); }, ); it('calls onClick callback when clicked a page (sample of mouse events family)', () => { const onClick = jest.fn(); - const component = mount(); + const { container } = render(); - const document = component.find('.react-pdf__Document'); - document.simulate('click'); + const document = container.querySelector('.react-pdf__Document'); + fireEvent.click(document); expect(onClick).toHaveBeenCalled(); }); @@ -517,10 +503,10 @@ describe('Document', () => { it('calls onTouchStart callback when touched a page (sample of touch events family)', () => { const onTouchStart = jest.fn(); - const component = mount(); + const { container } = render(); - const document = component.find('.react-pdf__Document'); - document.simulate('touchstart'); + const document = container.querySelector('.react-pdf__Document'); + fireEvent.touchStart(document); expect(onTouchStart).toHaveBeenCalled(); }); diff --git a/src/Outline.spec.jsx b/src/Outline.spec.jsx index 390634b0f..2da87fd34 100644 --- a/src/Outline.spec.jsx +++ b/src/Outline.spec.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { mount, shallow } from 'enzyme'; +import { render, screen } from '@testing-library/react'; import { pdfjs } from './entry.jest'; @@ -32,7 +32,7 @@ describe('Outline', () => { it('loads an outline and calls onLoadSuccess callback properly', async () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - shallow(); + render(); expect.assertions(1); await expect(onLoadSuccessPromise).resolves.toMatchObject(desiredLoadedOutline); @@ -43,7 +43,7 @@ describe('Outline', () => { muteConsole(); - shallow(); + render(); expect.assertions(1); await expect(onLoadErrorPromise).resolves.toBeInstanceOf(Error); @@ -54,24 +54,21 @@ describe('Outline', () => { it('replaces an outline properly when pdf is changed', async () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - const mountedComponent = shallow(); + const { rerender } = render(); expect.assertions(2); await expect(onLoadSuccessPromise).resolves.toMatchObject(desiredLoadedOutline); const { func: onLoadSuccess2, promise: onLoadSuccessPromise2 } = makeAsyncCallback(); - mountedComponent.setProps({ - onLoadSuccess: onLoadSuccess2, - pdf: pdf2, - }); + rerender(); // It would have been .toMatchObject if not for the fact _pdf2.pdf has no outline await expect(onLoadSuccessPromise2).resolves.toBe(desiredLoadedOutline2); }); it('throws an error when placed outside Document', () => { - expect(() => shallow()).toThrow(); + expect(() => render()).toThrow(); }); }); @@ -81,16 +78,16 @@ describe('Outline', () => { const className = 'testClassName'; - const component = shallow( + const { container } = render( , ); expect.assertions(1); await onLoadSuccessPromise; - const wrapperClassName = component.find('.react-pdf__Outline').prop('className'); + const wrapper = container.querySelector('.react-pdf__Outline'); - expect(wrapperClassName.includes(className)).toBe(true); + expect(wrapper).toHaveClass(className); }); it('passes container element to inputRef properly', async () => { @@ -98,7 +95,7 @@ describe('Outline', () => { const inputRef = jest.fn(); - mount(); + render(); expect.assertions(2); await onLoadSuccessPromise; @@ -110,14 +107,14 @@ describe('Outline', () => { it('renders OutlineItem components properly', async () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - const component = shallow(); + render(); expect.assertions(1); await onLoadSuccessPromise; - const items = component.children().find('OutlineItem'); + const items = screen.getAllByRole('listitem'); - expect(items).toHaveLength(desiredLoadedOutline.length); + expect(items).toHaveLength(5); }); }); }); diff --git a/src/OutlineItem.spec.jsx b/src/OutlineItem.spec.jsx index 3d8eb42b9..7a70f6adc 100644 --- a/src/OutlineItem.spec.jsx +++ b/src/OutlineItem.spec.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { shallow, mount } from 'enzyme'; +import { fireEvent, getAllByRole, render, screen } from '@testing-library/react'; import { pdfjs } from './entry.jest'; import { OutlineItemInternal as OutlineItem } from './OutlineItem'; @@ -24,17 +24,18 @@ describe('OutlineItem', () => { describe('rendering', () => { it('renders an item properly', () => { - const component = shallow(); + render(); - const title = component.find('a').first(); + const item = screen.getAllByRole('listitem')[0]; - expect(title.text()).toBe(outlineItem.title); + expect(item).toHaveTextContent(outlineItem.title); }); it("renders item's subitems properly", () => { - const component = mount(); + render(); - const subitems = component.children().find('OutlineItemInternal'); + const item = screen.getAllByRole('listitem')[0]; + const subitems = getAllByRole(item, 'listitem'); expect(subitems).toHaveLength(outlineItem.items.length); }); @@ -42,10 +43,11 @@ describe('OutlineItem', () => { it('calls onClick with proper arguments when clicked a link', () => { const { func: onClick, promise: onClickPromise } = makeAsyncCallback(); - const component = mount(); + render(); - const title = component.find('a').first(); - title.simulate('click'); + const item = screen.getAllByRole('listitem')[0]; + const link = getAllByRole(item, 'link')[0]; + fireEvent.click(link); return onClickPromise.then(() => { expect(onClick).toHaveBeenCalled(); diff --git a/src/Page.spec.jsx b/src/Page.spec.jsx index 3bf54902f..11356d308 100644 --- a/src/Page.spec.jsx +++ b/src/Page.spec.jsx @@ -1,5 +1,5 @@ -import React from 'react'; -import { mount, shallow } from 'enzyme'; +import React, { createRef } from 'react'; +import { fireEvent, render } from '@testing-library/react'; import { pdfjs } from './entry.jest'; @@ -12,6 +12,14 @@ import { loadPDF, makeAsyncCallback, muteConsole, restoreConsole } from '../test const pdfFile = loadPDF('./__mocks__/_pdf.pdf'); const pdfFile2 = loadPDF('./__mocks__/_pdf2.pdf'); +jest.mock( + './Page/AnnotationLayer', + () => + function AnnotationLayer() { + return
; + }, +); + describe('Page', () => { // Loaded PDF file let pdf; @@ -43,10 +51,7 @@ describe('Page', () => { desiredLoadedPage3._pageIndex = page3._pageIndex; desiredLoadedPage3._pageInfo = page3._pageInfo; - registerPageArguments.push( - page._pageIndex, - null, // Page reference is not defined in Enzyme - ); + registerPageArguments.push(page._pageIndex, expect.any(HTMLDivElement)); unregisterPageArguments = page._pageIndex; }); @@ -54,7 +59,7 @@ describe('Page', () => { it('loads a page and calls onLoadSuccess callback properly', async () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - shallow(); + render(); expect.assertions(1); await expect(onLoadSuccessPromise).resolves.toMatchObject(desiredLoadedPage); @@ -63,11 +68,10 @@ describe('Page', () => { it('returns all desired parameters in onLoadSuccess callback', () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - const component = shallow(); + render(); expect.assertions(5); return onLoadSuccessPromise.then((page) => { - component.update(); expect(page.width).toBeDefined(); expect(page.height).toBeDefined(); expect(page.originalWidth).toBeDefined(); @@ -82,7 +86,7 @@ describe('Page', () => { muteConsole(); - shallow(); + render(); expect.assertions(1); await expect(onLoadErrorPromise).resolves.toBeInstanceOf(Error); @@ -93,29 +97,29 @@ describe('Page', () => { it('loads page when given pageIndex', () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - const component = shallow(); + render(); expect.assertions(1); - return onLoadSuccessPromise.then(() => { - expect(component.state().page).toMatchObject(desiredLoadedPage); + return onLoadSuccessPromise.then((page) => { + expect(page).toMatchObject(desiredLoadedPage); }); }); it('loads page when given pageNumber', () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - const component = shallow(); + render(); expect.assertions(1); - return onLoadSuccessPromise.then(() => { - expect(component.state().page).toMatchObject(desiredLoadedPage); + return onLoadSuccessPromise.then((page) => { + expect(page).toMatchObject(desiredLoadedPage); }); }); it('calls registerPage when loaded a page', async () => { const { func: registerPage, promise: registerPagePromise } = makeAsyncCallback(); - shallow(); + render(); expect.assertions(1); await expect(registerPagePromise).resolves.toMatchObject(registerPageArguments); @@ -124,9 +128,9 @@ describe('Page', () => { it('calls unregisterPage on unmount', async () => { const { func: unregisterPage, promise: nuregisterPagePromise } = makeAsyncCallback(); - const component = shallow(); + const { unmount } = render(); - component.unmount(); + unmount(); expect.assertions(1); await expect(nuregisterPagePromise).resolves.toBe(unregisterPageArguments); @@ -135,19 +139,14 @@ describe('Page', () => { it('replaces a page properly when pdf is changed', async () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - const mountedComponent = shallow( - , - ); + const { rerender } = render(); expect.assertions(2); await expect(onLoadSuccessPromise).resolves.toMatchObject(desiredLoadedPage); const { func: onLoadSuccess2, promise: onLoadSuccessPromise2 } = makeAsyncCallback(); - mountedComponent.setProps({ - onLoadSuccess: onLoadSuccess2, - pdf: pdf2, - }); + rerender(); await expect(onLoadSuccessPromise2).resolves.toMatchObject(desiredLoadedPage3); }); @@ -155,25 +154,22 @@ describe('Page', () => { it('replaces a page properly when pageNumber is changed', async () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - const mountedComponent = shallow( - , - ); + const { rerender } = render(); expect.assertions(2); await expect(onLoadSuccessPromise).resolves.toMatchObject(desiredLoadedPage); const { func: onLoadSuccess2, promise: onLoadSuccessPromise2 } = makeAsyncCallback(); - mountedComponent.setProps({ - onLoadSuccess: onLoadSuccess2, - pageIndex: 1, - }); + rerender(); await expect(onLoadSuccessPromise2).resolves.toMatchObject(desiredLoadedPage2); }); it('throws an error when placed outside Document', () => { - expect(() => shallow()).toThrow(); + muteConsole(); + expect(() => render()).toThrow(); + restoreConsole(); }); }); @@ -181,17 +177,17 @@ describe('Page', () => { it('applies className to its wrapper when given a string', () => { const className = 'testClassName'; - const component = shallow(); + const { container } = render(); - const wrapperClassName = component.find('.react-pdf__Page').prop('className'); + const wrapper = container.querySelector('.react-pdf__Page'); - expect(wrapperClassName.includes(className)).toBe(true); + expect(wrapper).toHaveClass(className); }); it('passes container element to inputRef properly', () => { const inputRef = jest.fn(); - mount(); + render(); expect(inputRef).toHaveBeenCalled(); expect(inputRef.mock.calls[0][0]).toBeInstanceOf(HTMLElement); @@ -200,9 +196,9 @@ describe('Page', () => { it('passes canvas element to PageCanvas properly', async () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - const canvasRef = jest.fn(); + const canvasRef = createRef(); - const component = shallow( + const { container } = render( , ); @@ -210,20 +206,20 @@ describe('Page', () => { await onLoadSuccessPromise; - const pageCanvas = component.find('PageCanvas'); + const pageCanvas = container.querySelector('.react-pdf__Page__canvas'); - expect(pageCanvas.prop('canvasRef')).toBe(canvasRef); + expect(canvasRef.current).toBe(pageCanvas); }); it('renders "No page specified." when given neither pageIndex nor pageNumber', () => { muteConsole(); - const component = shallow(); + const { container } = render(); - const noData = component.find('Message'); + const noData = container.querySelector('.react-pdf__message'); - expect(noData).toHaveLength(1); - expect(noData.prop('children')).toBe('No page specified.'); + expect(noData).toBeInTheDocument(); + expect(noData).toHaveTextContent('No page specified.'); restoreConsole(); }); @@ -231,12 +227,12 @@ describe('Page', () => { it('renders custom no data message when given nothing and noData is given', () => { muteConsole(); - const component = shallow(); + const { container } = render(); - const noData = component.find('Message'); + const noData = container.querySelector('.react-pdf__message'); - expect(noData).toHaveLength(1); - expect(noData.prop('children')).toBe('Nothing here'); + expect(noData).toBeInTheDocument(); + expect(noData).toHaveTextContent('Nothing here'); restoreConsole(); }); @@ -244,150 +240,112 @@ describe('Page', () => { it('renders custom no data message when given nothing and noData is given as a function', () => { muteConsole(); - const component = shallow( 'Nothing here'} pdf={pdf} />); + const { container } = render( 'Nothing here'} pdf={pdf} />); - const noData = component.find('Message'); + const noData = container.querySelector('.react-pdf__message'); - expect(noData).toHaveLength(1); - expect(noData.prop('children')).toBe('Nothing here'); + expect(noData).toBeInTheDocument(); + expect(noData).toHaveTextContent('Nothing here'); restoreConsole(); }); it('renders "Loading page…" when loading a page', async () => { - const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); + const { container } = render(); - const component = shallow(); - - expect.assertions(2); - - await onLoadSuccessPromise; + const loading = container.querySelector('.react-pdf__message'); - // Since the page loads automatically, we need to simulate its loading state - component.setState({ page: null }); - - const loading = component.find('Message'); - - expect(loading).toHaveLength(1); - expect(loading.prop('children')).toBe('Loading page…'); + expect(loading).toBeInTheDocument(); + expect(loading).toHaveTextContent('Loading page…'); }); it('renders custom loading message when loading a page and loading prop is given', async () => { - const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - - const component = shallow( - , - ); - - expect.assertions(2); - - await onLoadSuccessPromise; - - // Since the page loads automatically, we need to simulate its loading state - component.setState({ page: null }); + const { container } = render(); - const loading = component.find('Message'); + const loading = container.querySelector('.react-pdf__message'); - expect(loading).toHaveLength(1); - expect(loading.prop('children')).toBe('Loading'); + expect(loading).toBeInTheDocument(); + expect(loading).toHaveTextContent('Loading'); }); it('renders custom loading message when loading a page and loading prop is given as a function', async () => { - const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - - const component = shallow( - , - ); - - expect.assertions(2); + const { container } = render( 'Loading'} pageIndex={0} pdf={pdf} />); - await onLoadSuccessPromise; + const loading = container.querySelector('.react-pdf__message'); - // Since the page loads automatically, we need to simulate its loading state - component.setState({ page: null }); - - const loading = component.find('Message'); - - expect(loading).toHaveLength(1); - expect(loading.prop('children')).toBe('Loading'); + expect(loading).toBeInTheDocument(); + expect(loading).toHaveTextContent('Loading'); }); - it('ignores pageIndex when given pageIndex and pageNumber', async () => { + it('ignores pageIndex when given pageIndex and pageNumber', () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - const component = shallow( - , - ); + render(); expect.assertions(1); - await onLoadSuccessPromise; - - expect(component.state().page).toMatchObject(desiredLoadedPage); + return onLoadSuccessPromise.then((page) => { + expect(page).toMatchObject(desiredLoadedPage); + }); }); - it('orders page to be rendered with default rotation when given nothing', async () => { + it('requests page to be rendered with default rotation when given nothing', async () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); + const instance = createRef(); - const component = shallow(); - - expect.assertions(1); + render(); await onLoadSuccessPromise; - expect(component.instance().rotate).toBe(0); + expect(instance.current.rotate).toBe(0); }); - it('requests page to be rendered with default rotation when given rotate prop', async () => { + it('requests page to be rendered with given rotation when given rotate prop', async () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); + const instance = createRef(); - const component = shallow( - , + render( + , ); - expect.assertions(1); - await onLoadSuccessPromise; - expect(component.instance().rotate).toBe(90); + expect(instance.current.rotate).toBe(90); }); it('requests page to be rendered in canvas mode by default', async () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - const component = shallow(); + const { container } = render(); expect.assertions(1); await onLoadSuccessPromise; - component.update(); - - const pageCanvas = component.find('PageCanvas'); - expect(pageCanvas).toHaveLength(1); + const pageCanvas = container.querySelector('.react-pdf__Page__canvas'); + expect(pageCanvas).toBeInTheDocument(); }); it('requests page not to be rendered when given renderMode = "none"', () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - const component = shallow( + const { container } = render( , ); expect.assertions(2); return onLoadSuccessPromise.then(() => { - component.update(); - const pageCanvas = component.find('PageCanvas'); - const pageSVG = component.find('PageSVG'); - expect(pageCanvas).toHaveLength(0); - expect(pageSVG).toHaveLength(0); + const pageCanvas = container.querySelector('.react-pdf__Page__canvas'); + const pageSVG = container.querySelector('.react-pdf__Page__svg'); + expect(pageCanvas).not.toBeInTheDocument(); + expect(pageSVG).not.toBeInTheDocument(); }); }); it('requests page to be rendered in canvas mode when given renderMode = "canvas"', async () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - const component = shallow( + const { container } = render( , ); @@ -395,16 +353,14 @@ describe('Page', () => { await onLoadSuccessPromise; - component.update(); - - const pageCanvas = component.find('PageCanvas'); - expect(pageCanvas).toHaveLength(1); + const pageCanvas = container.querySelector('.react-pdf__Page__canvas'); + expect(pageCanvas).toBeInTheDocument(); }); it('requests page to be rendered in SVG mode when given renderMode = "svg"', async () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - const component = shallow( + const { container } = render( , ); @@ -412,31 +368,27 @@ describe('Page', () => { await onLoadSuccessPromise; - component.update(); - - const pageSVG = component.find('PageSVG'); - expect(pageSVG).toHaveLength(1); + const pageSVG = container.querySelector('.react-pdf__Page__svg'); + expect(pageSVG).toBeInTheDocument(); }); it('requests text content to be rendered by default', async () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - const component = shallow(); + const { container } = render(); expect.assertions(1); await onLoadSuccessPromise; - component.update(); - - const textLayer = component.find('TextLayer'); - expect(textLayer).toHaveLength(1); + const textLayer = container.querySelector('.react-pdf__Page__textContent'); + expect(textLayer).toBeInTheDocument(); }); it('requests text content to be rendered when given renderTextLayer = true', async () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - const component = shallow( + const { container } = render( , ); @@ -444,16 +396,14 @@ describe('Page', () => { await onLoadSuccessPromise; - component.update(); - - const textLayer = component.find('TextLayer'); - expect(textLayer).toHaveLength(1); + const textLayer = container.querySelector('.react-pdf__Page__textContent'); + expect(textLayer).toBeInTheDocument(); }); it('does not request text content to be rendered when given renderTextLayer = false', async () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - const component = shallow( + const { container } = render( , ); @@ -461,16 +411,14 @@ describe('Page', () => { await onLoadSuccessPromise; - component.update(); - - const textLayer = component.find('TextLayer'); - expect(textLayer).toHaveLength(0); + const textLayer = container.querySelector('.react-pdf__Page__textContent'); + expect(textLayer).not.toBeInTheDocument(); }); it('renders TextLayer when given renderMode = "canvas"', async () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - const component = shallow( + const { container } = render( { await onLoadSuccessPromise; - component.update(); - - const textLayer = component.find('TextLayer'); - expect(textLayer).toHaveLength(1); + const textLayer = container.querySelector('.react-pdf__Page__textContent'); + expect(textLayer).toBeInTheDocument(); }); it('renders TextLayer when given renderMode = "svg"', async () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - const component = shallow( + const { container } = render( { await onLoadSuccessPromise; - component.update(); - const textLayer = component.find('TextLayer'); - expect(textLayer).toHaveLength(1); + const textLayer = container.querySelector('.react-pdf__Page__textContent'); + expect(textLayer).toBeInTheDocument(); }); it('requests annotations to be rendered by default', async () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - const component = shallow(); + const { container } = render(); expect.assertions(1); await onLoadSuccessPromise; - component.update(); - - const annotationLayer = component.find('AnnotationLayer'); - expect(annotationLayer).toHaveLength(1); + const annotationLayer = container.querySelector('.react-pdf__Page__annotations'); + expect(annotationLayer).toBeInTheDocument(); }); it('requests annotations to be rendered when given renderAnnotationLayer = true', async () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - const component = shallow( + const { container } = render( , ); @@ -538,16 +481,14 @@ describe('Page', () => { await onLoadSuccessPromise; - component.update(); - - const annotationLayer = component.find('AnnotationLayer'); - expect(annotationLayer).toHaveLength(1); + const annotationLayer = container.querySelector('.react-pdf__Page__annotations'); + expect(annotationLayer).toBeInTheDocument(); }); it('does not request annotations to be rendered when given renderAnnotationLayer = false', async () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - const component = shallow( + const { container } = render( { await onLoadSuccessPromise; - component.update(); - - const annotationLayer = component.find('AnnotationLayer'); - expect(annotationLayer).toHaveLength(0); + const annotationLayer = container.querySelector('.react-pdf__Page__annotations'); + expect(annotationLayer).not.toBeInTheDocument(); }); }); it('requests page to be rendered at its original size given nothing', () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); - const component = shallow(); + render(); expect.assertions(1); return onLoadSuccessPromise.then((page) => { - component.update(); - expect(page.width).toEqual(page.originalWidth); }); }); @@ -585,15 +522,11 @@ describe('Page', () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); const scale = 1.5; - const component = shallow( - , - ); + render(); expect.assertions(1); return onLoadSuccessPromise.then((page) => { - component.update(); - expect(page.width).toEqual(page.originalWidth * scale); }); }); @@ -602,15 +535,11 @@ describe('Page', () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); const width = 600; - const component = shallow( - , - ); + render(); expect.assertions(1); return onLoadSuccessPromise.then((page) => { - component.update(); - expect(page.width).toEqual(width); }); }); @@ -620,15 +549,13 @@ describe('Page', () => { const width = 600; const scale = 1.5; - const component = shallow( + render( , ); expect.assertions(1); return onLoadSuccessPromise.then((page) => { - component.update(); - expect(page.width).toBeCloseTo(width * scale); }); }); @@ -637,15 +564,11 @@ describe('Page', () => { const { func: onLoadSuccess, promise: onLoadSuccessPromise } = makeAsyncCallback(); const height = 850; - const component = shallow( - , - ); + render(); expect.assertions(1); return onLoadSuccessPromise.then((page) => { - component.update(); - expect(page.height).toEqual(height); }); }); @@ -655,15 +578,13 @@ describe('Page', () => { const height = 850; const scale = 1.5; - const component = shallow( + render( , ); expect.assertions(1); return onLoadSuccessPromise.then((page) => { - component.update(); - expect(page.height).toBeCloseTo(height * scale); }); }); @@ -673,15 +594,13 @@ describe('Page', () => { const width = 600; const height = 100; - const component = shallow( + render( , ); expect.assertions(2); return onLoadSuccessPromise.then((page) => { - component.update(); - expect(page.width).toEqual(width); // Expect proportions to be correct even though invalid height was provided expect(page.height).toEqual(page.originalHeight * (page.width / page.originalWidth)); @@ -694,7 +613,7 @@ describe('Page', () => { const height = 100; const scale = 1.5; - const component = shallow( + render( { expect.assertions(2); return onLoadSuccessPromise.then((page) => { - component.update(); - expect(page.width).toBeCloseTo(width * scale); // Expect proportions to be correct even though invalid height was provided expect(page.height).toEqual(page.originalHeight * (page.width / page.originalWidth)); @@ -719,10 +636,10 @@ describe('Page', () => { it('calls onClick callback when clicked a page (sample of mouse events family)', () => { const onClick = jest.fn(); - const component = mount(); + const { container } = render(); - const page = component.find('.react-pdf__Page'); - page.simulate('click'); + const page = container.querySelector('.react-pdf__Page'); + fireEvent.click(page); expect(onClick).toHaveBeenCalled(); }); @@ -730,10 +647,10 @@ describe('Page', () => { it('calls onTouchStart callback when touched a page (sample of touch events family)', () => { const onTouchStart = jest.fn(); - const component = mount(); + const { container } = render(); - const page = component.find('.react-pdf__Page'); - page.simulate('touchstart'); + const page = container.querySelector('.react-pdf__Page'); + fireEvent.touchStart(page); expect(onTouchStart).toHaveBeenCalled(); }); diff --git a/src/Page/AnnotationLayer.spec.jsx b/src/Page/AnnotationLayer.spec.jsx index 0662ff9de..8f4804593 100644 --- a/src/Page/AnnotationLayer.spec.jsx +++ b/src/Page/AnnotationLayer.spec.jsx @@ -1,5 +1,5 @@ -import React from 'react'; -import { mount, shallow } from 'enzyme'; +import React, { createRef } from 'react'; +import { render } from '@testing-library/react'; import { pdfjs } from '../entry.jest'; @@ -39,7 +39,7 @@ describe('AnnotationLayer', () => { const { func: onGetAnnotationsSuccess, promise: onGetAnnotationsSuccessPromise } = makeAsyncCallback(); - mount( + render( { muteConsole(); - mount( + render( { const { func: onGetAnnotationsSuccess, promise: onGetAnnotationsSuccessPromise } = makeAsyncCallback(); - const mountedComponent = mount( + const { rerender } = render( { const { func: onGetAnnotationsSuccess2, promise: onGetAnnotationsSuccessPromise2 } = makeAsyncCallback(); - mountedComponent.setProps({ - onGetAnnotationsSuccess: onGetAnnotationsSuccess2, - page: page2, - }); + rerender( + , + ); await expect(onGetAnnotationsSuccessPromise2).resolves.toMatchObject(desiredAnnotations2); }); it('throws an error when placed outside Page', () => { muteConsole(); - expect(() => shallow()).toThrow(); + expect(() => render()).toThrow(); restoreConsole(); }); }); @@ -111,7 +114,7 @@ describe('AnnotationLayer', () => { promise: onRenderAnnotationLayerSuccessPromise, } = makeAsyncCallback(); - const component = mount( + const { container } = render( { expect.assertions(1); return onRenderAnnotationLayerSuccessPromise.then(() => { - component.update(); - const renderedLayer = component.getDOMNode(); - const annotationItems = [...renderedLayer.children]; + const annotationItems = [...container.firstChild.children]; expect(annotationItems).toHaveLength(desiredAnnotations.length); }); @@ -149,7 +150,7 @@ describe('AnnotationLayer', () => { customLinkService.setExternalLinkTarget(externalLinkTarget); } - const component = mount( + const { container } = render( { expect.assertions(desiredAnnotations.length); return onRenderAnnotationLayerSuccessPromise.then(() => { - component.update(); - const renderedLayer = component.getDOMNode(); - const annotationItems = [...renderedLayer.children]; + const annotationItems = [...container.firstChild.children]; const annotationLinkItems = annotationItems .map((item) => item.firstChild) .filter((item) => item.tagName === 'A'); @@ -188,7 +187,7 @@ describe('AnnotationLayer', () => { customLinkService.setExternalLinkRel(externalLinkRel); } - const component = mount( + const { container } = render( { expect.assertions(desiredAnnotations.length); return onRenderAnnotationLayerSuccessPromise.then(() => { - component.update(); - const renderedLayer = component.getDOMNode(); - const annotationItems = [...renderedLayer.children]; + const annotationItems = [...container.firstChild.children]; const annotationLinkItems = annotationItems .map((item) => item.firstChild) .filter((item) => item.tagName === 'A'); @@ -217,20 +214,21 @@ describe('AnnotationLayer', () => { promise: onRenderAnnotationLayerSuccessPromise, } = makeAsyncCallback(); const rotate = 90; + const instance = createRef(); - const component = mount( + render( , ); expect.assertions(1); return onRenderAnnotationLayerSuccessPromise.then(() => { - component.update(); - const { viewport } = component.instance(); + const { viewport } = instance.current; expect(viewport.rotation).toEqual(rotate); }); @@ -242,20 +240,21 @@ describe('AnnotationLayer', () => { promise: onRenderAnnotationLayerSuccessPromise, } = makeAsyncCallback(); const scale = 2; + const instance = createRef(); - const component = mount( + render( , ); expect.assertions(1); return onRenderAnnotationLayerSuccessPromise.then(() => { - component.update(); - const { viewport } = component.instance(); + const { viewport } = instance.current; expect(viewport.scale).toEqual(scale); }); @@ -274,7 +273,7 @@ describe('AnnotationLayer', () => { `]+src="${imageResourcesPath}annotation-note.svg"`, ); - const component = mount( + const { container } = render( { expect.assertions(1); return onRenderAnnotationLayerSuccessPromise.then(() => { - component.update(); - const stringifiedAnnotationLayerNode = component.html(); + const stringifiedAnnotationLayerNode = container.outerHTML; + expect(stringifiedAnnotationLayerNode).toMatch(desiredImageTagRegExp); }); }); @@ -303,7 +302,7 @@ describe('AnnotationLayer', () => { `]+src="${imageResourcesPath}annotation-note.svg"`, ); - const component = mount( + const { container } = render( { expect.assertions(1); return onRenderAnnotationLayerSuccessPromise.then(() => { - component.update(); - const stringifiedAnnotationLayerNode = component.html(); + const stringifiedAnnotationLayerNode = container.outerHTML; + expect(stringifiedAnnotationLayerNode).toMatch(desiredImageTagRegExp); }); }); diff --git a/src/Page/PageCanvas.spec.jsx b/src/Page/PageCanvas.spec.jsx index 3884c5f29..c52ff26e6 100644 --- a/src/Page/PageCanvas.spec.jsx +++ b/src/Page/PageCanvas.spec.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { mount } from 'enzyme'; +import { render } from '@testing-library/react'; import { pdfjs } from '../entry.jest'; @@ -34,7 +34,7 @@ describe('PageCanvas', () => { muteConsole(); - mount( + render( , ); @@ -50,7 +50,7 @@ describe('PageCanvas', () => { muteConsole(); - mount(); + render(); expect.assertions(1); @@ -64,7 +64,7 @@ describe('PageCanvas', () => { it('passes canvas element to canvasRef properly', () => { const canvasRef = jest.fn(); - mount(); + render(); expect(canvasRef).toHaveBeenCalled(); expect(canvasRef.mock.calls[0][0]).toBeInstanceOf(HTMLElement); diff --git a/src/Page/PageSVG.spec.jsx b/src/Page/PageSVG.spec.jsx index 95f89a56a..a8f90aad1 100644 --- a/src/Page/PageSVG.spec.jsx +++ b/src/Page/PageSVG.spec.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { mount } from 'enzyme'; +import { render } from '@testing-library/react'; import { pdfjs } from '../entry.jest'; @@ -27,7 +27,7 @@ describe('PageSVG', () => { muteConsole(); - mount(); + render(); expect.assertions(1); @@ -41,7 +41,7 @@ describe('PageSVG', () => { muteConsole(); - mount(); + render(); expect.assertions(1); diff --git a/src/Page/TextLayer.spec.jsx b/src/Page/TextLayer.spec.jsx index 83c95c1aa..9911e65ab 100644 --- a/src/Page/TextLayer.spec.jsx +++ b/src/Page/TextLayer.spec.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { mount, shallow } from 'enzyme'; +import { render } from '@testing-library/react'; import { pdfjs } from '../entry.jest'; @@ -36,7 +36,7 @@ describe('TextLayer', () => { it('loads text content and calls onGetTextSuccess callback properly', async () => { const { func: onGetTextSuccess, promise: onGetTextSuccessPromise } = makeAsyncCallback(); - mount(); + render(); expect.assertions(1); await expect(onGetTextSuccessPromise).resolves.toMatchObject({ items: desiredTextItems }); @@ -47,7 +47,7 @@ describe('TextLayer', () => { muteConsole(); - mount(); + render(); expect.assertions(1); await expect(onGetTextErrorPromise).resolves.toBeInstanceOf(Error); @@ -58,7 +58,7 @@ describe('TextLayer', () => { it('replaces text content properly', async () => { const { func: onGetTextSuccess, promise: onGetTextSuccessPromise } = makeAsyncCallback(); - const mountedComponent = mount(); + const { rerender } = render(); expect.assertions(2); await expect(onGetTextSuccessPromise).resolves.toMatchObject({ @@ -67,10 +67,7 @@ describe('TextLayer', () => { const { func: onGetTextSuccess2, promise: onGetTextSuccessPromise2 } = makeAsyncCallback(); - mountedComponent.setProps({ - onGetTextSuccess: onGetTextSuccess2, - page: page2, - }); + rerender(); await expect(onGetTextSuccessPromise2).resolves.toMatchObject({ items: desiredTextItems2, @@ -79,7 +76,7 @@ describe('TextLayer', () => { it('throws an error when placed outside Page', () => { muteConsole(); - expect(() => shallow()).toThrow(); + expect(() => render()).toThrow(); restoreConsole(); }); }); @@ -89,13 +86,13 @@ describe('TextLayer', () => { const { func: onRenderTextLayerSuccess, promise: onRenderTextLayerSuccessPromise } = makeAsyncCallback(); - const component = mount( + const { container } = render( , ); expect.assertions(1); return onRenderTextLayerSuccessPromise.then(() => { - const textItems = component.getDOMNode().children; + const textItems = [...container.firstChild.children]; expect(textItems).toHaveLength(desiredTextItems.length); }); @@ -107,7 +104,7 @@ describe('TextLayer', () => { const customTextRenderer = jest.fn(); - mount( + render( { const customTextRenderer = () => 'Test value'; - const component = mount( + const { container } = render( { expect.assertions(1); return onRenderTextLayerSuccessPromise.then(() => { - const textItem = component.text(); - expect(textItem).toContain('Test value'); + expect(container).toHaveTextContent('Test value'); }); }); }); diff --git a/yarn.lock b/yarn.lock index bd030f5e1..53aac128e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -32,7 +32,7 @@ __metadata: languageName: node linkType: hard -"@babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.16.7": +"@babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.16.7": version: 7.16.7 resolution: "@babel/code-frame@npm:7.16.7" dependencies: @@ -1345,7 +1345,7 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.10.2, @babel/runtime@npm:^7.16.3, @babel/runtime@npm:^7.8.4": +"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.10.2, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.16.3, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.9.2": version: 7.16.7 resolution: "@babel/runtime@npm:7.16.7" dependencies: @@ -1708,6 +1708,53 @@ __metadata: languageName: node linkType: hard +"@testing-library/dom@npm:^8.0.0": + version: 8.13.0 + resolution: "@testing-library/dom@npm:8.13.0" + dependencies: + "@babel/code-frame": ^7.10.4 + "@babel/runtime": ^7.12.5 + "@types/aria-query": ^4.2.0 + aria-query: ^5.0.0 + chalk: ^4.1.0 + dom-accessibility-api: ^0.5.9 + lz-string: ^1.4.4 + pretty-format: ^27.0.2 + checksum: 880f1872b9949800d4444e3bdbd03df86d6f41ec7c27136dff1da29e87d2df2d7ee904afcdf895ffce351c25bd12119117eae023354d50e707ad56d43b2ed3ed + languageName: node + linkType: hard + +"@testing-library/jest-dom@npm:^5.15.0": + version: 5.16.4 + resolution: "@testing-library/jest-dom@npm:5.16.4" + dependencies: + "@babel/runtime": ^7.9.2 + "@types/testing-library__jest-dom": ^5.9.1 + aria-query: ^5.0.0 + chalk: ^3.0.0 + css: ^3.0.0 + css.escape: ^1.5.1 + dom-accessibility-api: ^0.5.6 + lodash: ^4.17.15 + redent: ^3.0.0 + checksum: 4240501223b72b97a44d4e3c669f39b208c49fb645d11d08d5f178d607265c5dfad07efbe027f41a0e2458178ff1fd5bf437fc05661b9109dcd013b95a37079e + languageName: node + linkType: hard + +"@testing-library/react@npm:^12.1.0": + version: 12.1.5 + resolution: "@testing-library/react@npm:12.1.5" + dependencies: + "@babel/runtime": ^7.12.5 + "@testing-library/dom": ^8.0.0 + "@types/react-dom": <18.0.0 + peerDependencies: + react: <18.0.0 + react-dom: <18.0.0 + checksum: 4abd0490405e709a7df584a0db604e508a4612398bb1326e8fa32dd9393b15badc826dcf6d2f7525437886d507871f719f127b9860ed69ddd204d1fa834f576a + languageName: node + linkType: hard + "@tootallnate/once@npm:1": version: 1.1.2 resolution: "@tootallnate/once@npm:1.1.2" @@ -1722,6 +1769,13 @@ __metadata: languageName: node linkType: hard +"@types/aria-query@npm:^4.2.0": + version: 4.2.2 + resolution: "@types/aria-query@npm:4.2.2" + checksum: 6f2ce11d91e2d665f3873258db19da752d91d85d3679eb5efcdf9c711d14492287e1e4eb52613b28e60375841a9e428594e745b68436c963d8bad4bf72188df3 + languageName: node + linkType: hard + "@types/babel__core@npm:^7.0.0, @types/babel__core@npm:^7.1.14": version: 7.1.18 resolution: "@types/babel__core@npm:7.1.18" @@ -1824,6 +1878,16 @@ __metadata: languageName: node linkType: hard +"@types/jest@npm:*": + version: 27.5.1 + resolution: "@types/jest@npm:27.5.1" + dependencies: + jest-matcher-utils: ^27.0.0 + pretty-format: ^27.0.0 + checksum: be20e39f7aaf17179109c0060d0a0489cec2034d4e2e28a631284c7ecd13c5ae52f62697a33a0e89b03b6cfe54e9d5e8c2bd387ab2bd90d6071d68c63b86d1e3 + languageName: node + linkType: hard + "@types/json-schema@npm:*, @types/json-schema@npm:^7.0.8": version: 7.0.9 resolution: "@types/json-schema@npm:7.0.9" @@ -1859,6 +1923,40 @@ __metadata: languageName: node linkType: hard +"@types/prop-types@npm:*": + version: 15.7.5 + resolution: "@types/prop-types@npm:15.7.5" + checksum: 5b43b8b15415e1f298243165f1d44390403bb2bd42e662bca3b5b5633fdd39c938e91b7fce3a9483699db0f7a715d08cef220c121f723a634972fdf596aec980 + languageName: node + linkType: hard + +"@types/react-dom@npm:<18.0.0": + version: 17.0.17 + resolution: "@types/react-dom@npm:17.0.17" + dependencies: + "@types/react": ^17 + checksum: 23caf98aa03e968811560f92a2c8f451694253ebe16b670929b24eaf0e7fa62ba549abe9db0ac028a9d8a9086acd6ab9c6c773f163fa21224845edbc00ba6232 + languageName: node + linkType: hard + +"@types/react@npm:^17": + version: 17.0.45 + resolution: "@types/react@npm:17.0.45" + dependencies: + "@types/prop-types": "*" + "@types/scheduler": "*" + csstype: ^3.0.2 + checksum: 3cc13a02824c13f6fa4807a83abd065ac1d9943359e76bd995cc7cd2b4148c1176ebd54a30a9f4eb8a0f141ff359d712876f256c4fee707e4290607ef8410b3e + languageName: node + linkType: hard + +"@types/scheduler@npm:*": + version: 0.16.2 + resolution: "@types/scheduler@npm:0.16.2" + checksum: b6b4dcfeae6deba2e06a70941860fb1435730576d3689225a421280b7742318d1548b3d22c1f66ab68e414f346a9542f29240bc955b6332c5b11e561077583bc + languageName: node + linkType: hard + "@types/stack-utils@npm:^2.0.0": version: 2.0.1 resolution: "@types/stack-utils@npm:2.0.1" @@ -1866,6 +1964,15 @@ __metadata: languageName: node linkType: hard +"@types/testing-library__jest-dom@npm:^5.9.1": + version: 5.14.3 + resolution: "@types/testing-library__jest-dom@npm:5.14.3" + dependencies: + "@types/jest": "*" + checksum: 203443d0e7e5929fbc9e441146f92d85efa033b4697e427ed0164df1c40b720b6bb9bbd96a3171ea5fd8d9301b538fd0f49d4f35594d142afd0f6d2ecac25785 + languageName: node + linkType: hard + "@types/yargs-parser@npm:*": version: 20.2.1 resolution: "@types/yargs-parser@npm:20.2.1" @@ -2033,38 +2140,6 @@ __metadata: languageName: node linkType: hard -"@wojtekmaj/enzyme-adapter-react-17@npm:^0.6.0": - version: 0.6.6 - resolution: "@wojtekmaj/enzyme-adapter-react-17@npm:0.6.6" - dependencies: - "@wojtekmaj/enzyme-adapter-utils": ^0.1.2 - enzyme-shallow-equal: ^1.0.0 - has: ^1.0.0 - prop-types: ^15.7.0 - react-is: ^17.0.0 - react-test-renderer: ^17.0.0 - peerDependencies: - enzyme: ^3.0.0 - react: ^17.0.0-0 - react-dom: ^17.0.0-0 - checksum: bf6dad41313456d7a80fdd44e0a0e95a49af8f841b1d0ac5a03c48973877ecaf9ac4d457e3f6edd0df7d40abfe625a8aaa77ffb822224a25e5e866be41d9ea0f - languageName: node - linkType: hard - -"@wojtekmaj/enzyme-adapter-utils@npm:^0.1.2": - version: 0.1.2 - resolution: "@wojtekmaj/enzyme-adapter-utils@npm:0.1.2" - dependencies: - function.prototype.name: ^1.1.0 - has: ^1.0.0 - object.fromentries: ^2.0.0 - prop-types: ^15.7.0 - peerDependencies: - react: ^17.0.0-0 - checksum: 4b2f5ff155c600137342c0ee19512b27d469fef98c20fee85785014e71d21b75cab48f93c8004548bd86410395e7577265acfa873e7a2d863c73291734c6d652 - languageName: node - linkType: hard - "@xtuc/ieee754@npm:^1.2.0": version: 1.2.0 resolution: "@xtuc/ieee754@npm:1.2.0" @@ -2291,6 +2366,13 @@ __metadata: languageName: node linkType: hard +"aria-query@npm:^5.0.0": + version: 5.0.0 + resolution: "aria-query@npm:5.0.0" + checksum: c41f98866c5a304561ee8cae55856711cddad6f3f85d8cb43cc5f79667078d9b8979ce32d244c1ff364e6463a4d0b6865804a33ccc717fed701b281cf7dc6296 + languageName: node + linkType: hard + "array-differ@npm:^3.0.0": version: 3.0.0 resolution: "array-differ@npm:3.0.0" @@ -2318,20 +2400,7 @@ __metadata: languageName: node linkType: hard -"array.prototype.filter@npm:^1.0.0": - version: 1.0.1 - resolution: "array.prototype.filter@npm:1.0.1" - dependencies: - call-bind: ^1.0.2 - define-properties: ^1.1.3 - es-abstract: ^1.19.0 - es-array-method-boxes-properly: ^1.0.0 - is-string: ^1.0.7 - checksum: 574b52dcebf2def7bedb05449b60e5e3819093fa77f88c3f87a9611361d2745c7aacde01cd3ed7accafd632ee1e0340b655dd26dc7c060429cb4566058e63134 - languageName: node - linkType: hard - -"array.prototype.flat@npm:^1.2.3, array.prototype.flat@npm:^1.2.5": +"array.prototype.flat@npm:^1.2.5": version: 1.2.5 resolution: "array.prototype.flat@npm:1.2.5" dependencies: @@ -2374,6 +2443,15 @@ __metadata: languageName: node linkType: hard +"atob@npm:^2.1.2": + version: 2.1.2 + resolution: "atob@npm:2.1.2" + bin: + atob: bin/atob.js + checksum: dfeeeb70090c5ebea7be4b9f787f866686c645d9f39a0d184c817252d0cf08455ed25267d79c03254d3be1f03ac399992a792edcd5ffb9c91e097ab5ef42833a + languageName: node + linkType: hard + "axe-core@npm:^4.3.5": version: 4.3.5 resolution: "axe-core@npm:4.3.5" @@ -2531,13 +2609,6 @@ __metadata: languageName: node linkType: hard -"boolbase@npm:^1.0.0": - version: 1.0.0 - resolution: "boolbase@npm:1.0.0" - checksum: 3e25c80ef626c3a3487c73dbfc70ac322ec830666c9ad915d11b701142fab25ec1e63eff2c450c74347acfd2de854ccde865cd79ef4db1683f7c7b046ea43bb0 - languageName: node - linkType: hard - "brace-expansion@npm:^1.1.7": version: 1.1.11 resolution: "brace-expansion@npm:1.1.11" @@ -2680,7 +2751,7 @@ __metadata: languageName: node linkType: hard -"chalk@npm:^4.0.0": +"chalk@npm:^4.0.0, chalk@npm:^4.1.0": version: 4.1.2 resolution: "chalk@npm:4.1.2" dependencies: @@ -2697,34 +2768,6 @@ __metadata: languageName: node linkType: hard -"cheerio-select@npm:^1.5.0": - version: 1.5.0 - resolution: "cheerio-select@npm:1.5.0" - dependencies: - css-select: ^4.1.3 - css-what: ^5.0.1 - domelementtype: ^2.2.0 - domhandler: ^4.2.0 - domutils: ^2.7.0 - checksum: d4506d8b9ad330a18f9de3a5a22138d0804063e92aac2fc020384cc52ab86d2194d2ae614fc87f0e2a62b6a6dd0c28ad23669cec64331172a9f99ad604863010 - languageName: node - linkType: hard - -"cheerio@npm:^1.0.0-rc.3": - version: 1.0.0-rc.10 - resolution: "cheerio@npm:1.0.0-rc.10" - dependencies: - cheerio-select: ^1.5.0 - dom-serializer: ^1.3.2 - domhandler: ^4.2.0 - htmlparser2: ^6.1.0 - parse5: ^6.0.1 - parse5-htmlparser2-tree-adapter: ^6.0.1 - tslib: ^2.2.0 - checksum: ace2f9c5809737534b1320d11d48762013694fa905b4deacac81a634edac178c1b0534f79d7b1896a88ce489db6cb539f222317996b21c8b6923ce413dcc1a2f - languageName: node - linkType: hard - "chokidar@npm:^3.4.0": version: 3.5.3 resolution: "chokidar@npm:3.5.3" @@ -2854,7 +2897,7 @@ __metadata: languageName: node linkType: hard -"commander@npm:^2.19.0, commander@npm:^2.20.0": +"commander@npm:^2.20.0": version: 2.20.3 resolution: "commander@npm:2.20.3" checksum: ab8c07884e42c3a8dbc5dd9592c606176c7eb5c1ca5ff274bcf907039b2c41de3626f684ea75ccf4d361ba004bbaff1f577d5384c155f3871e456bdf27becf9e @@ -2919,23 +2962,21 @@ __metadata: languageName: node linkType: hard -"css-select@npm:^4.1.3": - version: 4.2.1 - resolution: "css-select@npm:4.2.1" - dependencies: - boolbase: ^1.0.0 - css-what: ^5.1.0 - domhandler: ^4.3.0 - domutils: ^2.8.0 - nth-check: ^2.0.1 - checksum: 6617193ec7c332217204c4ea371d332c6845603fda415e36032e7e9e18206d7c368a14e3c57532082314d2689955b01122aa1097c1c52b6c1cab7ad90970d3c6 +"css.escape@npm:^1.5.1": + version: 1.5.1 + resolution: "css.escape@npm:1.5.1" + checksum: f6d38088d870a961794a2580b2b2af1027731bb43261cfdce14f19238a88664b351cc8978abc20f06cc6bbde725699dec8deb6fe9816b139fc3f2af28719e774 languageName: node linkType: hard -"css-what@npm:^5.0.1, css-what@npm:^5.1.0": - version: 5.1.0 - resolution: "css-what@npm:5.1.0" - checksum: 0b75d1bac95c885c168573c85744a6c6843d8c33345f54f717218b37ea6296b0e99bb12105930ea170fd4a921990392a7c790c16c585c1d8960c49e2b7ec39f7 +"css@npm:^3.0.0": + version: 3.0.0 + resolution: "css@npm:3.0.0" + dependencies: + inherits: ^2.0.4 + source-map: ^0.6.1 + source-map-resolve: ^0.6.0 + checksum: 4273ac816ddf99b99acb9c1d1a27d86d266a533cc01118369d941d8e8a78277a83cad3315e267a398c509d930fbb86504e193ea1ebc620a4a4212e06fe76e8be languageName: node linkType: hard @@ -2969,6 +3010,13 @@ __metadata: languageName: node linkType: hard +"csstype@npm:^3.0.2": + version: 3.1.0 + resolution: "csstype@npm:3.1.0" + checksum: 644e986cefab86525f0b674a06889cfdbb1f117e5b7d1ce0fc55b0423ecc58807a1ea42ecc75c4f18999d14fc42d1d255f84662a45003a52bb5840e977eb2ffd + languageName: node + linkType: hard + "damerau-levenshtein@npm:^1.0.7": version: 1.0.8 resolution: "damerau-levenshtein@npm:1.0.8" @@ -3024,6 +3072,13 @@ __metadata: languageName: node linkType: hard +"decode-uri-component@npm:^0.2.0": + version: 0.2.0 + resolution: "decode-uri-component@npm:0.2.0" + checksum: f3749344ab9305ffcfe4bfe300e2dbb61fc6359e2b736812100a3b1b6db0a5668cba31a05e4b45d4d63dbf1a18dfa354cd3ca5bb3ededddabb8cd293f4404f94 + languageName: node + linkType: hard + "dedent@npm:^0.7.0": version: 0.7.0 resolution: "dedent@npm:0.7.0" @@ -3082,17 +3137,10 @@ __metadata: languageName: node linkType: hard -"diff-sequences@npm:^27.4.0": - version: 27.4.0 - resolution: "diff-sequences@npm:27.4.0" - checksum: 66d04033e8632eeacdd029b4ecaf87d233d475e4b0cd1cee035eda99e70e1a7f803507d72f2677990ef526f28a2f6e5709af8d94dcdc0682b8884a3a646190a1 - languageName: node - linkType: hard - -"discontinuous-range@npm:1.0.0": - version: 1.0.0 - resolution: "discontinuous-range@npm:1.0.0" - checksum: 8ee88d7082445b6eadc7c03bebe6dc978f96760c45e9f65d16ca66174d9e086a9e3855ee16acf65625e1a07a846a17de674f02a5964a6aebe5963662baf8b5c8 +"diff-sequences@npm:^27.5.1": + version: 27.5.1 + resolution: "diff-sequences@npm:27.5.1" + checksum: a00db5554c9da7da225db2d2638d85f8e41124eccbd56cbaefb3b276dcbb1c1c2ad851c32defe2055a54a4806f030656cbf6638105fd6ce97bb87b90b32a33ca languageName: node linkType: hard @@ -3114,21 +3162,10 @@ __metadata: languageName: node linkType: hard -"dom-serializer@npm:^1.0.1, dom-serializer@npm:^1.3.2": - version: 1.3.2 - resolution: "dom-serializer@npm:1.3.2" - dependencies: - domelementtype: ^2.0.1 - domhandler: ^4.2.0 - entities: ^2.0.0 - checksum: bff48714944d67b160db71ba244fb0f3fe72e77ef2ec8414e2eeb56f2d926e404a13456b8b83a5392e217ba47dec2ec0c368801b31481813e94d185276c3e964 - languageName: node - linkType: hard - -"domelementtype@npm:^2.0.1, domelementtype@npm:^2.2.0": - version: 2.2.0 - resolution: "domelementtype@npm:2.2.0" - checksum: 24cb386198640cd58aa36f8c987f2ea61859929106d06ffcc8f547e70cb2ed82a6dc56dcb8252b21fba1f1ea07df6e4356d60bfe57f77114ca1aed6828362629 +"dom-accessibility-api@npm:^0.5.6, dom-accessibility-api@npm:^0.5.9": + version: 0.5.14 + resolution: "dom-accessibility-api@npm:0.5.14" + checksum: 782c813f75a09ba6735ef03b5e1624406a3829444ae49d5bdedd272a49d437ae3354f53e02ffc8c9fd9165880250f41546538f27461f839dd4ea1234e77e8d5e languageName: node linkType: hard @@ -3141,26 +3178,6 @@ __metadata: languageName: node linkType: hard -"domhandler@npm:^4.0.0, domhandler@npm:^4.2.0, domhandler@npm:^4.3.0": - version: 4.3.0 - resolution: "domhandler@npm:4.3.0" - dependencies: - domelementtype: ^2.2.0 - checksum: d2a2dbf40dd99abf936b65ad83c6b530afdb3605a87cad37a11b5d9220e68423ebef1b86c89e0f6d93ffaf315cc327cf1a988652e7a9a95cce539e3984f4c64d - languageName: node - linkType: hard - -"domutils@npm:^2.5.2, domutils@npm:^2.7.0, domutils@npm:^2.8.0": - version: 2.8.0 - resolution: "domutils@npm:2.8.0" - dependencies: - dom-serializer: ^1.0.1 - domelementtype: ^2.2.0 - domhandler: ^4.2.0 - checksum: abf7434315283e9aadc2a24bac0e00eab07ae4313b40cc239f89d84d7315ebdfd2fb1b5bf750a96bc1b4403d7237c7b2ebf60459be394d625ead4ca89b934391 - languageName: node - linkType: hard - "electron-to-chromium@npm:^1.4.17": version: 1.4.57 resolution: "electron-to-chromium@npm:1.4.57" @@ -3224,13 +3241,6 @@ __metadata: languageName: node linkType: hard -"entities@npm:^2.0.0": - version: 2.2.0 - resolution: "entities@npm:2.2.0" - checksum: 19010dacaf0912c895ea262b4f6128574f9ccf8d4b3b65c7e8334ad0079b3706376360e28d8843ff50a78aabcb8f08f0a32dbfacdc77e47ed77ca08b713669b3 - languageName: node - linkType: hard - "env-paths@npm:^2.2.0": version: 2.2.1 resolution: "env-paths@npm:2.2.1" @@ -3238,46 +3248,6 @@ __metadata: languageName: node linkType: hard -"enzyme-shallow-equal@npm:^1.0.0, enzyme-shallow-equal@npm:^1.0.1": - version: 1.0.4 - resolution: "enzyme-shallow-equal@npm:1.0.4" - dependencies: - has: ^1.0.3 - object-is: ^1.1.2 - checksum: 54bbad0955683f09252568bfcb9d7e934a27c06634057db9e82b54c0d9f7a27b6160d77643177d973c133b87d404f284cc6aa0481c0a1c81cdff05b072e2bb49 - languageName: node - linkType: hard - -"enzyme@npm:^3.10.0": - version: 3.11.0 - resolution: "enzyme@npm:3.11.0" - dependencies: - array.prototype.flat: ^1.2.3 - cheerio: ^1.0.0-rc.3 - enzyme-shallow-equal: ^1.0.1 - function.prototype.name: ^1.1.2 - has: ^1.0.3 - html-element-map: ^1.2.0 - is-boolean-object: ^1.0.1 - is-callable: ^1.1.5 - is-number-object: ^1.0.4 - is-regex: ^1.0.5 - is-string: ^1.0.5 - is-subset: ^0.1.1 - lodash.escape: ^4.0.1 - lodash.isequal: ^4.5.0 - object-inspect: ^1.7.0 - object-is: ^1.0.2 - object.assign: ^4.1.0 - object.entries: ^1.1.1 - object.values: ^1.1.1 - raf: ^3.4.1 - rst-selector-parser: ^2.2.3 - string.prototype.trim: ^1.2.1 - checksum: 69ae80049c3f405122b8e619f1cf8b04f32b3cc2b6134c29ed8c0f05e87a0b15080f1121096ec211954a710f4787300af9157078c863012de87eee16e98e64ea - languageName: node - linkType: hard - "err-code@npm:^2.0.2": version: 2.0.3 resolution: "err-code@npm:2.0.3" @@ -3313,13 +3283,6 @@ __metadata: languageName: node linkType: hard -"es-array-method-boxes-properly@npm:^1.0.0": - version: 1.0.0 - resolution: "es-array-method-boxes-properly@npm:1.0.0" - checksum: 2537fcd1cecf187083890bc6f5236d3a26bf39237433587e5bf63392e88faae929dbba78ff0120681a3f6f81c23fe3816122982c160d63b38c95c830b633b826 - languageName: node - linkType: hard - "es-module-lexer@npm:^0.9.0": version: 0.9.3 resolution: "es-module-lexer@npm:0.9.3" @@ -3863,18 +3826,6 @@ __metadata: languageName: node linkType: hard -"function.prototype.name@npm:^1.1.0, function.prototype.name@npm:^1.1.2": - version: 1.1.5 - resolution: "function.prototype.name@npm:1.1.5" - dependencies: - call-bind: ^1.0.2 - define-properties: ^1.1.3 - es-abstract: ^1.19.0 - functions-have-names: ^1.2.2 - checksum: acd21d733a9b649c2c442f067567743214af5fa248dbeee69d8278ce7df3329ea5abac572be9f7470b4ec1cd4d8f1040e3c5caccf98ebf2bf861a0deab735c27 - languageName: node - linkType: hard - "functional-red-black-tree@npm:^1.0.1": version: 1.0.1 resolution: "functional-red-black-tree@npm:1.0.1" @@ -3882,13 +3833,6 @@ __metadata: languageName: node linkType: hard -"functions-have-names@npm:^1.2.2": - version: 1.2.2 - resolution: "functions-have-names@npm:1.2.2" - checksum: 25f44b6d1c41ac86ffdf41f25d1de81c0a5b4a3fcf4307a33cdfb23b9d4bd5d0d8bf312eaef5ad368c6500c8a9e19f692b8ce9f96aaab99db9dd936554165558 - languageName: node - linkType: hard - "gauge@npm:^4.0.0": version: 4.0.0 resolution: "gauge@npm:4.0.0" @@ -4070,7 +4014,7 @@ __metadata: languageName: node linkType: hard -"has@npm:^1.0.0, has@npm:^1.0.3": +"has@npm:^1.0.3": version: 1.0.3 resolution: "has@npm:1.0.3" dependencies: @@ -4079,16 +4023,6 @@ __metadata: languageName: node linkType: hard -"html-element-map@npm:^1.2.0": - version: 1.3.1 - resolution: "html-element-map@npm:1.3.1" - dependencies: - array.prototype.filter: ^1.0.0 - call-bind: ^1.0.2 - checksum: 7408da008d37bfa76b597e298ae0ed530258065deb29fbd73d40f7cbd123b654d1022a7a8cfbe713e57d90c5bef844399f5c8a46cde7d55c91d305024c921d08 - languageName: node - linkType: hard - "html-encoding-sniffer@npm:^2.0.1": version: 2.0.1 resolution: "html-encoding-sniffer@npm:2.0.1" @@ -4105,18 +4039,6 @@ __metadata: languageName: node linkType: hard -"htmlparser2@npm:^6.1.0": - version: 6.1.0 - resolution: "htmlparser2@npm:6.1.0" - dependencies: - domelementtype: ^2.0.1 - domhandler: ^4.0.0 - domutils: ^2.5.2 - entities: ^2.0.0 - checksum: 81a7b3d9c3bb9acb568a02fc9b1b81ffbfa55eae7f1c41ae0bf840006d1dbf54cb3aa245b2553e2c94db674840a9f0fdad7027c9a9d01a062065314039058c4e - languageName: node - linkType: hard - "http-cache-semantics@npm:^4.1.0": version: 4.1.0 resolution: "http-cache-semantics@npm:4.1.0" @@ -4273,7 +4195,7 @@ __metadata: languageName: node linkType: hard -"inherits@npm:2, inherits@npm:^2.0.3": +"inherits@npm:2, inherits@npm:^2.0.3, inherits@npm:^2.0.4": version: 2.0.4 resolution: "inherits@npm:2.0.4" checksum: 4a48a733847879d6cf6691860a6b1e3f0f4754176e4d71494c41f3475553768b10f84b5ce1d40fbd0e34e6bfbb864ee35858ad4dd2cf31e02fc4a154b724d7f1 @@ -4316,7 +4238,7 @@ __metadata: languageName: node linkType: hard -"is-boolean-object@npm:^1.0.1, is-boolean-object@npm:^1.1.0": +"is-boolean-object@npm:^1.1.0": version: 1.1.2 resolution: "is-boolean-object@npm:1.1.2" dependencies: @@ -4326,7 +4248,7 @@ __metadata: languageName: node linkType: hard -"is-callable@npm:^1.1.4, is-callable@npm:^1.1.5, is-callable@npm:^1.2.4": +"is-callable@npm:^1.1.4, is-callable@npm:^1.2.4": version: 1.2.4 resolution: "is-callable@npm:1.2.4" checksum: 1a28d57dc435797dae04b173b65d6d1e77d4f16276e9eff973f994eadcfdc30a017e6a597f092752a083c1103cceb56c91e3dadc6692fedb9898dfaba701575f @@ -4418,7 +4340,7 @@ __metadata: languageName: node linkType: hard -"is-regex@npm:^1.0.5, is-regex@npm:^1.1.4": +"is-regex@npm:^1.1.4": version: 1.1.4 resolution: "is-regex@npm:1.1.4" dependencies: @@ -4451,13 +4373,6 @@ __metadata: languageName: node linkType: hard -"is-subset@npm:^0.1.1": - version: 0.1.1 - resolution: "is-subset@npm:0.1.1" - checksum: 97b8d7852af165269b7495095691a6ce6cf20bdfa1f846f97b4560ee190069686107af4e277fbd93aa0845c4d5db704391460ff6e9014aeb73264ba87893df44 - languageName: node - linkType: hard - "is-symbol@npm:^1.0.2, is-symbol@npm:^1.0.3": version: 1.0.4 resolution: "is-symbol@npm:1.0.4" @@ -4652,15 +4567,15 @@ __metadata: languageName: node linkType: hard -"jest-diff@npm:^27.4.6": - version: 27.4.6 - resolution: "jest-diff@npm:27.4.6" +"jest-diff@npm:^27.4.6, jest-diff@npm:^27.5.1": + version: 27.5.1 + resolution: "jest-diff@npm:27.5.1" dependencies: chalk: ^4.0.0 - diff-sequences: ^27.4.0 - jest-get-type: ^27.4.0 - pretty-format: ^27.4.6 - checksum: cf6b7e80e3c64a7c71ab209c0325bbda175991aed985ecee7652df9d6540e4959089038e208c04ab05391c9ddf07adc72f0c8c26cc4cee6fa17f76f500e2bf43 + diff-sequences: ^27.5.1 + jest-get-type: ^27.5.1 + pretty-format: ^27.5.1 + checksum: 8be27c1e1ee57b2bb2bef9c0b233c19621b4c43d53a3c26e2c00a4e805eb4ea11fe1694a06a9fb0e80ffdcfdc0d2b1cb0b85920b3f5c892327ecd1e7bd96b865 languageName: node linkType: hard @@ -4715,10 +4630,10 @@ __metadata: languageName: node linkType: hard -"jest-get-type@npm:^27.4.0": - version: 27.4.0 - resolution: "jest-get-type@npm:27.4.0" - checksum: bb9b70e420009fdaed3026d5bccd01569f92c7500f9f544d862796d4f4efa93ced5484864b2f272c7748bfb5bfd3268d48868b169c51ab45fe5b45b9519b6e46 +"jest-get-type@npm:^27.4.0, jest-get-type@npm:^27.5.1": + version: 27.5.1 + resolution: "jest-get-type@npm:27.5.1" + checksum: 63064ab70195c21007d897c1157bf88ff94a790824a10f8c890392e7d17eda9c3900513cb291ca1c8d5722cad79169764e9a1279f7c8a9c4cd6e9109ff04bbc0 languageName: node linkType: hard @@ -4781,15 +4696,15 @@ __metadata: languageName: node linkType: hard -"jest-matcher-utils@npm:^27.4.6": - version: 27.4.6 - resolution: "jest-matcher-utils@npm:27.4.6" +"jest-matcher-utils@npm:^27.0.0, jest-matcher-utils@npm:^27.4.6": + version: 27.5.1 + resolution: "jest-matcher-utils@npm:27.5.1" dependencies: chalk: ^4.0.0 - jest-diff: ^27.4.6 - jest-get-type: ^27.4.0 - pretty-format: ^27.4.6 - checksum: 445a8cc9eaa7cb08653a10cfc4f109eca76a97d1b1d3a01067bd77efa9cb3a554b74c7402a4c9d5083b21e11218e1515ef538faa47fa47c282072b4825f6b307 + jest-diff: ^27.5.1 + jest-get-type: ^27.5.1 + pretty-format: ^27.5.1 + checksum: bb2135fc48889ff3fe73888f6cc7168ddab9de28b51b3148f820c89fdfd2effdcad005f18be67d0b9be80eda208ad47290f62f03d0a33f848db2dd0273c8217a languageName: node linkType: hard @@ -5275,27 +5190,6 @@ __metadata: languageName: node linkType: hard -"lodash.escape@npm:^4.0.1": - version: 4.0.1 - resolution: "lodash.escape@npm:4.0.1" - checksum: fcb54f457497256964d619d5cccbd80a961916fca60df3fe0fa3e7f052715c2944c0ed5aefb4f9e047d127d44aa2d55555f3350cb42c6549e9e293fb30b41e7f - languageName: node - linkType: hard - -"lodash.flattendeep@npm:^4.4.0": - version: 4.4.0 - resolution: "lodash.flattendeep@npm:4.4.0" - checksum: 8521c919acac3d4bcf0aaf040c1ca9cb35d6c617e2d72e9b4d51c9a58b4366622cd6077441a18be626c3f7b28227502b3bf042903d447b056ee7e0b11d45c722 - languageName: node - linkType: hard - -"lodash.isequal@npm:^4.5.0": - version: 4.5.0 - resolution: "lodash.isequal@npm:4.5.0" - checksum: da27515dc5230eb1140ba65ff8de3613649620e8656b19a6270afe4866b7bd461d9ba2ac8a48dcc57f7adac4ee80e1de9f965d89d4d81a0ad52bb3eec2609644 - languageName: node - linkType: hard - "lodash.merge@npm:^4.6.2": version: 4.6.2 resolution: "lodash.merge@npm:4.6.2" @@ -5303,7 +5197,7 @@ __metadata: languageName: node linkType: hard -"lodash@npm:^4.7.0": +"lodash@npm:^4.17.15, lodash@npm:^4.7.0": version: 4.17.21 resolution: "lodash@npm:4.17.21" checksum: eb835a2e51d381e561e508ce932ea50a8e5a68f4ebdd771ea240d3048244a8d13658acbd502cd4829768c56f2e16bdd4340b9ea141297d472517b83868e677f7 @@ -5337,6 +5231,15 @@ __metadata: languageName: node linkType: hard +"lz-string@npm:^1.4.4": + version: 1.4.4 + resolution: "lz-string@npm:1.4.4" + bin: + lz-string: bin/bin.js + checksum: 54e31238a61a84d8f664d9860a9fba7310c5b97a52c444f80543069bc084815eff40b8d4474ae1d93992fdf6c252dca37cf27f6adbeb4dbc3df2f3ac773d0e61 + languageName: node + linkType: hard + "make-cancellable-promise@npm:^1.0.0": version: 1.1.0 resolution: "make-cancellable-promise@npm:1.1.0" @@ -5457,6 +5360,13 @@ __metadata: languageName: node linkType: hard +"min-indent@npm:^1.0.0": + version: 1.0.1 + resolution: "min-indent@npm:1.0.1" + checksum: bfc6dd03c5eaf623a4963ebd94d087f6f4bbbfd8c41329a7f09706b0cb66969c4ddd336abeb587bc44bc6f08e13bf90f0b374f9d71f9f01e04adc2cd6f083ef1 + languageName: node + linkType: hard + "minimatch@npm:^3.0.4": version: 3.0.4 resolution: "minimatch@npm:3.0.4" @@ -5561,13 +5471,6 @@ __metadata: languageName: node linkType: hard -"moo@npm:^0.5.0": - version: 0.5.1 - resolution: "moo@npm:0.5.1" - checksum: 2d8c013f1f9aad8e5c7a9d4a03dbb4eecd91b9fe5e9446fbc7561fd38d4d161c742434acff385722542fe7b360fce9c586da62442379e62e4158ad49c7e1a6b7 - languageName: node - linkType: hard - "mri@npm:^1.1.5": version: 1.2.0 resolution: "mri@npm:1.2.0" @@ -5616,23 +5519,6 @@ __metadata: languageName: node linkType: hard -"nearley@npm:^2.7.10": - version: 2.20.1 - resolution: "nearley@npm:2.20.1" - dependencies: - commander: ^2.19.0 - moo: ^0.5.0 - railroad-diagrams: ^1.0.0 - randexp: 0.4.6 - bin: - nearley-railroad: bin/nearley-railroad.js - nearley-test: bin/nearley-test.js - nearley-unparse: bin/nearley-unparse.js - nearleyc: bin/nearleyc.js - checksum: 42c2c330c13c7991b48221c5df00f4352c2f8851636ae4d1f8ca3c8e193fc1b7668c78011d1cad88cca4c1c4dc087425420629c19cc286d7598ec15533aaef26 - languageName: node - linkType: hard - "negotiator@npm:^0.6.3": version: 0.6.3 resolution: "negotiator@npm:0.6.3" @@ -5720,15 +5606,6 @@ __metadata: languageName: node linkType: hard -"nth-check@npm:^2.0.1": - version: 2.0.1 - resolution: "nth-check@npm:2.0.1" - dependencies: - boolbase: ^1.0.0 - checksum: 5386d035c48438ff304fe687704d93886397349d1bed136de97aeae464caba10e8ffac55a04b215b86b3bc8897f33e0a5aa1045a9d8b2f251ae61b2a3ad3e450 - languageName: node - linkType: hard - "nwsapi@npm:^2.2.0": version: 2.2.0 resolution: "nwsapi@npm:2.2.0" @@ -5743,23 +5620,13 @@ __metadata: languageName: node linkType: hard -"object-inspect@npm:^1.11.0, object-inspect@npm:^1.7.0, object-inspect@npm:^1.9.0": +"object-inspect@npm:^1.11.0, object-inspect@npm:^1.9.0": version: 1.12.0 resolution: "object-inspect@npm:1.12.0" checksum: 2b36d4001a9c921c6b342e2965734519c9c58c355822243c3207fbf0aac271f8d44d30d2d570d450b2cc6f0f00b72bcdba515c37827d2560e5f22b1899a31cf4 languageName: node linkType: hard -"object-is@npm:^1.0.2, object-is@npm:^1.1.2": - version: 1.1.5 - resolution: "object-is@npm:1.1.5" - dependencies: - call-bind: ^1.0.2 - define-properties: ^1.1.3 - checksum: 989b18c4cba258a6b74dc1d74a41805c1a1425bce29f6cabb50dcb1a6a651ea9104a1b07046739a49a5bb1bc49727bcb00efd5c55f932f6ea04ec8927a7901fe - languageName: node - linkType: hard - "object-keys@npm:^1.0.12, object-keys@npm:^1.1.1": version: 1.1.1 resolution: "object-keys@npm:1.1.1" @@ -5779,7 +5646,7 @@ __metadata: languageName: node linkType: hard -"object.entries@npm:^1.1.1, object.entries@npm:^1.1.5": +"object.entries@npm:^1.1.5": version: 1.1.5 resolution: "object.entries@npm:1.1.5" dependencies: @@ -5790,7 +5657,7 @@ __metadata: languageName: node linkType: hard -"object.fromentries@npm:^2.0.0, object.fromentries@npm:^2.0.5": +"object.fromentries@npm:^2.0.5": version: 2.0.5 resolution: "object.fromentries@npm:2.0.5" dependencies: @@ -5811,7 +5678,7 @@ __metadata: languageName: node linkType: hard -"object.values@npm:^1.1.1, object.values@npm:^1.1.5": +"object.values@npm:^1.1.5": version: 1.1.5 resolution: "object.values@npm:1.1.5" dependencies: @@ -5936,16 +5803,7 @@ __metadata: languageName: node linkType: hard -"parse5-htmlparser2-tree-adapter@npm:^6.0.1": - version: 6.0.1 - resolution: "parse5-htmlparser2-tree-adapter@npm:6.0.1" - dependencies: - parse5: ^6.0.1 - checksum: 1848378b355d027915645c13f13f982e60502d201f53bc2067a508bf2dba4aac08219fc781dcd160167f5f50f0c73f58d20fa4fb3d90ee46762c20234fa90a6d - languageName: node - linkType: hard - -"parse5@npm:6.0.1, parse5@npm:^6.0.1": +"parse5@npm:6.0.1": version: 6.0.1 resolution: "parse5@npm:6.0.1" checksum: 7d569a176c5460897f7c8f3377eff640d54132b9be51ae8a8fa4979af940830b2b0c296ce75e5bd8f4041520aadde13170dbdec44889975f906098ea0002f4bd @@ -6001,13 +5859,6 @@ __metadata: languageName: node linkType: hard -"performance-now@npm:^2.1.0": - version: 2.1.0 - resolution: "performance-now@npm:2.1.0" - checksum: 534e641aa8f7cba160f0afec0599b6cecefbb516a2e837b512be0adbe6c1da5550e89c78059c7fabc5c9ffdf6627edabe23eb7c518c4500067a898fa65c2b550 - languageName: node - linkType: hard - "picocolors@npm:^1.0.0": version: 1.0.0 resolution: "picocolors@npm:1.0.0" @@ -6068,14 +5919,14 @@ __metadata: languageName: node linkType: hard -"pretty-format@npm:^27.4.6": - version: 27.4.6 - resolution: "pretty-format@npm:27.4.6" +"pretty-format@npm:^27.0.0, pretty-format@npm:^27.0.2, pretty-format@npm:^27.4.6, pretty-format@npm:^27.5.1": + version: 27.5.1 + resolution: "pretty-format@npm:27.5.1" dependencies: ansi-regex: ^5.0.1 ansi-styles: ^5.0.0 react-is: ^17.0.1 - checksum: 5eda32e4e47ddd1a9e8fe9ebef519b217ba403eb8bcb804ba551dfb37f87e674472013fcf78480ab535844fdddcc706fac94511eba349bfb94a138a02d1a7a59 + checksum: cf610cffcb793885d16f184a62162f2dd0df31642d9a18edf4ca298e909a8fe80bdbf556d5c9573992c102ce8bf948691da91bf9739bee0ffb6e79c8a8a6e088 languageName: node linkType: hard @@ -6124,7 +5975,7 @@ __metadata: languageName: node linkType: hard -"prop-types@npm:^15.6.2, prop-types@npm:^15.7.0, prop-types@npm:^15.7.2": +"prop-types@npm:^15.6.2, prop-types@npm:^15.7.2": version: 15.8.1 resolution: "prop-types@npm:15.8.1" dependencies: @@ -6159,32 +6010,6 @@ __metadata: languageName: node linkType: hard -"raf@npm:^3.4.1": - version: 3.4.1 - resolution: "raf@npm:3.4.1" - dependencies: - performance-now: ^2.1.0 - checksum: 50ba284e481c8185dbcf45fc4618ba3aec580bb50c9121385d5698cb6012fe516d2015b1df6dd407a7b7c58d44be8086108236affbce1861edd6b44637c8cd52 - languageName: node - linkType: hard - -"railroad-diagrams@npm:^1.0.0": - version: 1.0.0 - resolution: "railroad-diagrams@npm:1.0.0" - checksum: 9e312af352b5ed89c2118edc0c06cef2cc039681817f65266719606e4e91ff6ae5374c707cc9033fe29a82c2703edf3c63471664f97f0167c85daf6f93496319 - languageName: node - linkType: hard - -"randexp@npm:0.4.6": - version: 0.4.6 - resolution: "randexp@npm:0.4.6" - dependencies: - discontinuous-range: 1.0.0 - ret: ~0.1.10 - checksum: 3c0d440a3f89d6d36844aa4dd57b5cdb0cab938a41956a16da743d3a3578ab32538fc41c16cc0984b6938f2ae4cbc0216967e9829e52191f70e32690d8e3445d - languageName: node - linkType: hard - "randombytes@npm:^2.1.0": version: 2.1.0 resolution: "randombytes@npm:2.1.0" @@ -6207,13 +6032,6 @@ __metadata: languageName: node linkType: hard -"react-is@npm:^16.12.0 || ^17.0.0, react-is@npm:^17.0.0, react-is@npm:^17.0.1, react-is@npm:^17.0.2": - version: 17.0.2 - resolution: "react-is@npm:17.0.2" - checksum: 9d6d111d8990dc98bc5402c1266a808b0459b5d54830bbea24c12d908b536df7883f268a7868cfaedde3dd9d4e0d574db456f84d2e6df9c4526f99bb4b5344d8 - languageName: node - linkType: hard - "react-is@npm:^16.13.1": version: 16.13.1 resolution: "react-is@npm:16.13.1" @@ -6221,6 +6039,13 @@ __metadata: languageName: node linkType: hard +"react-is@npm:^17.0.1": + version: 17.0.2 + resolution: "react-is@npm:17.0.2" + checksum: 9d6d111d8990dc98bc5402c1266a808b0459b5d54830bbea24c12d908b536df7883f268a7868cfaedde3dd9d4e0d574db456f84d2e6df9c4526f99bb4b5344d8 + languageName: node + linkType: hard + "react-pdf@workspace:.": version: 0.0.0-use.local resolution: "react-pdf@workspace:." @@ -6231,8 +6056,8 @@ __metadata: "@babel/preset-env": ^7.15.0 "@babel/preset-react": ^7.14.0 "@babel/runtime": ^7.0.0 - "@wojtekmaj/enzyme-adapter-react-17": ^0.6.0 - enzyme: ^3.10.0 + "@testing-library/jest-dom": ^5.15.0 + "@testing-library/react": ^12.1.0 eslint: ^8.5.0 eslint-config-wojtekmaj: ^0.6.5 file-loader: ^6.0.0 @@ -6259,32 +6084,6 @@ __metadata: languageName: unknown linkType: soft -"react-shallow-renderer@npm:^16.13.1": - version: 16.14.1 - resolution: "react-shallow-renderer@npm:16.14.1" - dependencies: - object-assign: ^4.1.1 - react-is: ^16.12.0 || ^17.0.0 - peerDependencies: - react: ^16.0.0 || ^17.0.0 - checksum: f344c663c48720d19559b4198b1f63ad47a3f11bedc92ede053a6c0706b5209e6110086f3ccc6db04eda9f0d1a415845956ddfb6ce09a922167d4831fcba9314 - languageName: node - linkType: hard - -"react-test-renderer@npm:^17.0.0": - version: 17.0.2 - resolution: "react-test-renderer@npm:17.0.2" - dependencies: - object-assign: ^4.1.1 - react-is: ^17.0.2 - react-shallow-renderer: ^16.13.1 - scheduler: ^0.20.2 - peerDependencies: - react: 17.0.2 - checksum: e6b5c6ed2a0bde2c34f1ab9523ff9bc4c141a271daf730d6b852374e83acc0155d58ab71a318251e953ebfa65b8bebb9c5dce3eba1ccfcbef7cc4e1e8261c401 - languageName: node - linkType: hard - "react@npm:^17.0.0": version: 17.0.2 resolution: "react@npm:17.0.2" @@ -6315,6 +6114,16 @@ __metadata: languageName: node linkType: hard +"redent@npm:^3.0.0": + version: 3.0.0 + resolution: "redent@npm:3.0.0" + dependencies: + indent-string: ^4.0.0 + strip-indent: ^3.0.0 + checksum: fa1ef20404a2d399235e83cc80bd55a956642e37dd197b4b612ba7327bf87fa32745aeb4a1634b2bab25467164ab4ed9c15be2c307923dd08b0fe7c52431ae6b + languageName: node + linkType: hard + "regenerate-unicode-properties@npm:^9.0.0": version: 9.0.0 resolution: "regenerate-unicode-properties@npm:9.0.0" @@ -6479,13 +6288,6 @@ __metadata: languageName: node linkType: hard -"ret@npm:~0.1.10": - version: 0.1.15 - resolution: "ret@npm:0.1.15" - checksum: d76a9159eb8c946586567bd934358dfc08a36367b3257f7a3d7255fdd7b56597235af23c6afa0d7f0254159e8051f93c918809962ebd6df24ca2a83dbe4d4151 - languageName: node - linkType: hard - "retry@npm:^0.12.0": version: 0.12.0 resolution: "retry@npm:0.12.0" @@ -6504,16 +6306,6 @@ __metadata: languageName: node linkType: hard -"rst-selector-parser@npm:^2.2.3": - version: 2.2.3 - resolution: "rst-selector-parser@npm:2.2.3" - dependencies: - lodash.flattendeep: ^4.4.0 - nearley: ^2.7.10 - checksum: fbfb2f6a7d4c9b3e013ef555ac06e5dba444e0d37dc959b94c507b6c34093ef10fe98141338d9cac58e5ae0f9453a5ef7f85af3d5e6386b237c1b3552debe4a0 - languageName: node - linkType: hard - "safe-buffer@npm:^5.1.0, safe-buffer@npm:~5.2.0": version: 5.2.1 resolution: "safe-buffer@npm:5.2.1" @@ -6693,6 +6485,16 @@ __metadata: languageName: node linkType: hard +"source-map-resolve@npm:^0.6.0": + version: 0.6.0 + resolution: "source-map-resolve@npm:0.6.0" + dependencies: + atob: ^2.1.2 + decode-uri-component: ^0.2.0 + checksum: fe503b9e5dac1c54be835282fcfec10879434e7b3ee08a9774f230299c724a8d403484d9531276d1670c87390e0e4d1d3f92b14cca6e4a2445ea3016b786ecd4 + languageName: node + linkType: hard + "source-map-support@npm:^0.5.6, source-map-support@npm:~0.5.20": version: 0.5.21 resolution: "source-map-support@npm:0.5.21" @@ -6786,17 +6588,6 @@ __metadata: languageName: node linkType: hard -"string.prototype.trim@npm:^1.2.1": - version: 1.2.5 - resolution: "string.prototype.trim@npm:1.2.5" - dependencies: - call-bind: ^1.0.2 - define-properties: ^1.1.3 - es-abstract: ^1.19.1 - checksum: d9f748ffca2a3ce722c421f7c2993b6490ec0cf19d9cb0904598c744e9367e54a3f13c7b99c8c0966c8a76484bd656a60281daa5d0534cc222cd72193fd63034 - languageName: node - linkType: hard - "string.prototype.trimend@npm:^1.0.4": version: 1.0.4 resolution: "string.prototype.trimend@npm:1.0.4" @@ -6856,6 +6647,15 @@ __metadata: languageName: node linkType: hard +"strip-indent@npm:^3.0.0": + version: 3.0.0 + resolution: "strip-indent@npm:3.0.0" + dependencies: + min-indent: ^1.0.0 + checksum: 18f045d57d9d0d90cd16f72b2313d6364fd2cb4bf85b9f593523ad431c8720011a4d5f08b6591c9d580f446e78855c5334a30fb91aa1560f5d9f95ed1b4a0530 + languageName: node + linkType: hard + "strip-json-comments@npm:^3.1.0, strip-json-comments@npm:^3.1.1": version: 3.1.1 resolution: "strip-json-comments@npm:3.1.1" @@ -7079,13 +6879,6 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^2.2.0": - version: 2.3.1 - resolution: "tslib@npm:2.3.1" - checksum: de17a98d4614481f7fcb5cd53ffc1aaf8654313be0291e1bfaee4b4bb31a20494b7d218ff2e15017883e8ea9626599b3b0e0229c18383ba9dce89da2adf15cb9 - languageName: node - linkType: hard - "type-check@npm:^0.4.0, type-check@npm:~0.4.0": version: 0.4.0 resolution: "type-check@npm:0.4.0"