Skip to content
Snippets Groups Projects
Unverified Commit e7ba59a9 authored by Nick Budak's avatar Nick Budak Committed by GitHub
Browse files

Merge pull request #3547 from ProjectMirador/update-dev-deps

Update development dependencies and test with current versions of nodejs
parents fe18ed21 1e65f2de
Branches
No related tags found
No related merge requests found
Showing
with 97 additions and 117 deletions
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
"page": true, "page": true,
"document": true "document": true
}, },
"parser": "babel-eslint",
"plugins": ["jest"], "plugins": ["jest"],
"rules": { "rules": {
"import/prefer-default-export": "off", "import/prefer-default-export": "off",
...@@ -29,6 +28,8 @@ ...@@ -29,6 +28,8 @@
"natural": false "natural": false
}], }],
"react/jsx-props-no-spreading": "off", "react/jsx-props-no-spreading": "off",
"react/function-component-definition": "off",
"default-param-last": "off",
"arrow-parens": "off", "arrow-parens": "off",
"import/no-anonymous-default-export": "off", "import/no-anonymous-default-export": "off",
"max-len": ["error", { "max-len": ["error", {
......
...@@ -12,13 +12,16 @@ on: ...@@ -12,13 +12,16 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 17.x]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Use Node.js 14.x - name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: 14.x node-version: ${{ matrix.node-version }}
- run: npm install -g codecov - run: npm install -g codecov
- run: npm install - run: npm install
- run: npm test - run: npm test
......
...@@ -6,7 +6,7 @@ describe('Companion Windows', () => { ...@@ -6,7 +6,7 @@ describe('Companion Windows', () => {
await expect(page).toFill('#manifestURL', 'http://127.0.0.1:4488/__tests__/fixtures/version-2/001.json'); await expect(page).toFill('#manifestURL', 'http://127.0.0.1:4488/__tests__/fixtures/version-2/001.json');
await expect(page).toClick('#fetchBtn'); await expect(page).toClick('#fetchBtn');
await expect(page).toClick('[data-manifestid="http://127.0.0.1:4488/__tests__/fixtures/version-2/001.json"] button'); await expect(page).toClick('[data-manifestid="http://127.0.0.1:4488/__tests__/fixtures/version-2/001.json"] button');
await page.waitFor(300); await page.waitForTimeout(300);
await expect(page).toMatchElement('.mirador-window'); await expect(page).toMatchElement('.mirador-window');
}); });
......
...@@ -8,7 +8,7 @@ describe('Mirador Invalid API Response Handler Test', () => { ...@@ -8,7 +8,7 @@ describe('Mirador Invalid API Response Handler Test', () => {
await page.evaluate(() => { await page.evaluate(() => {
document.querySelector('.mirador-add-resource-button').click(); document.querySelector('.mirador-add-resource-button').click();
}); });
await page.waitFor(50); await page.waitForTimeout(50);
await expect(page).toFill('#manifestURL', uri); await expect(page).toFill('#manifestURL', uri);
await expect(page).toClick('#fetchBtn'); await expect(page).toClick('#fetchBtn');
...@@ -25,16 +25,12 @@ describe('Mirador Invalid API Response Handler Test', () => { ...@@ -25,16 +25,12 @@ describe('Mirador Invalid API Response Handler Test', () => {
it('renders an error message when a manifest cannot be loaded (and allows it to be dismissed)', async () => { it('renders an error message when a manifest cannot be loaded (and allows it to be dismissed)', async () => {
await fetchManifest('http://127.0.0.1:4488/__tests__/fixtures/version-2/broken'); await fetchManifest('http://127.0.0.1:4488/__tests__/fixtures/version-2/broken');
await expect(page).toMatchElement( await expect(page).toMatchElement('p', { text: 'The resource cannot be added:', timeout: 2000 });
'p', { text: 'The resource cannot be added:', timeout: 2000 }, await expect(page).toMatchElement('p', { text: 'http://127.0.0.1:4488/__tests__/fixtures/version-2/broken' });
);
await expect(page).toMatchElement(
'p', { text: 'http://127.0.0.1:4488/__tests__/fixtures/version-2/broken' },
);
await expect(page).toClick('button', { text: 'Dismiss' }); await expect(page).toClick('button', { text: 'Dismiss' });
await page.waitFor(() => !document.querySelector('li[data-manifestid="http://127.0.0.1:4488/__tests__/fixtures/version-2/broken"]')); await page.waitForFunction(() => !document.querySelector('li[data-manifestid="http://127.0.0.1:4488/__tests__/fixtures/version-2/broken"]'));
await expect(page).not.toMatchElement( await expect(page).not.toMatchElement(
'p', 'p',
......
...@@ -16,7 +16,7 @@ describe('Language Switching', () => { ...@@ -16,7 +16,7 @@ describe('Language Switching', () => {
await expect(page).toMatchElement('[aria-label="Start Here"]'); await expect(page).toMatchElement('[aria-label="Start Here"]');
await expect(page).not.toMatchElement('[aria-label="Hier starten"]'); await expect(page).not.toMatchElement('[aria-label="Hier starten"]');
await expect(page).toClick('li', { text: 'Deutsch' }); await expect(page).toClick('li', { text: 'Deutsch' });
await page.waitFor(1000); await page.waitForTimeout(1000);
await expect(page).not.toMatchElement('[aria-label="Start Here"]'); await expect(page).not.toMatchElement('[aria-label="Start Here"]');
await expect(page).toMatchElement('[aria-label="Hier starten"]'); await expect(page).toMatchElement('[aria-label="Hier starten"]');
}); });
......
...@@ -2,7 +2,7 @@ describe('add two plugins to <WorkspaceControlPanelButtons>', () => { ...@@ -2,7 +2,7 @@ describe('add two plugins to <WorkspaceControlPanelButtons>', () => {
beforeAll(async () => { beforeAll(async () => {
await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/plugins/add.html'); await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/plugins/add.html');
await expect(page).toMatchElement('.mirador-viewer'); await expect(page).toMatchElement('.mirador-viewer');
await page.waitFor(1000); await page.waitForTimeout(1000);
}); });
it('all add plugins will be added to <WorkspaceControlPanelButtons>', async () => { it('all add plugins will be added to <WorkspaceControlPanelButtons>', async () => {
......
...@@ -2,13 +2,13 @@ describe('add plugins for companion windows', () => { ...@@ -2,13 +2,13 @@ describe('add plugins for companion windows', () => {
beforeAll(async () => { beforeAll(async () => {
await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/plugins/companionWindow.html'); await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/plugins/companionWindow.html');
await expect(page).toMatchElement('.mirador-viewer'); await expect(page).toMatchElement('.mirador-viewer');
await page.waitFor(1000); await page.waitForTimeout(1000);
}); });
it('added a plugin to the window sidebar and companion window', async () => { it('added a plugin to the window sidebar and companion window', async () => {
await expect(page).toClick('button[aria-label="Toggle sidebar"]'); await expect(page).toClick('button[aria-label="Toggle sidebar"]');
await page.waitFor(1000); await page.waitForTimeout(1000);
await expect(page).toMatchElement('.mirador-companion-window-left.mirador-window-sidebar-info-panel'); await expect(page).toMatchElement('.mirador-companion-window-left.mirador-window-sidebar-info-panel');
await expect(page).toMatchElement('#add-plugin-companion-window-button'); await expect(page).toMatchElement('#add-plugin-companion-window-button');
......
...@@ -2,7 +2,7 @@ describe('try to apply 2 add plugins and 2 wrap plugins to <WorkspaceControlPane ...@@ -2,7 +2,7 @@ describe('try to apply 2 add plugins and 2 wrap plugins to <WorkspaceControlPane
beforeAll(async () => { beforeAll(async () => {
await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/plugins/priority.html'); await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/plugins/priority.html');
await expect(page).toMatchElement('.mirador-viewer'); await expect(page).toMatchElement('.mirador-viewer');
await page.waitFor(1000); await page.waitForTimeout(1000);
}); });
it('only apply the first wrap plugin', async () => { it('only apply the first wrap plugin', async () => {
......
...@@ -4,7 +4,7 @@ describe('how plugins relate to state', () => { ...@@ -4,7 +4,7 @@ describe('how plugins relate to state', () => {
beforeAll(async () => { beforeAll(async () => {
await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/plugins/state.html'); await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/plugins/state.html');
await expect(page).toMatchElement('.mirador-viewer'); await expect(page).toMatchElement('.mirador-viewer');
await page.waitFor(1000); await page.waitForTimeout(1000);
}); });
it('plugin can read from state', async () => { it('plugin can read from state', async () => {
......
...@@ -2,7 +2,7 @@ describe('pass valid and invalid plugins to <WorkspaceControlPanelButtons>', () ...@@ -2,7 +2,7 @@ describe('pass valid and invalid plugins to <WorkspaceControlPanelButtons>', ()
beforeAll(async () => { beforeAll(async () => {
await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/plugins/validate.html'); await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/plugins/validate.html');
await expect(page).toMatchElement('.mirador-viewer'); await expect(page).toMatchElement('.mirador-viewer');
await page.waitFor(1000); await page.waitForTimeout(1000);
}); });
it('valid plugins will be applied <WorkspaceControlPanelButtons>', async () => { it('valid plugins will be applied <WorkspaceControlPanelButtons>', async () => {
......
...@@ -2,7 +2,7 @@ describe('wrap <WorkspaceControlPanelButtons> by a plugin', () => { ...@@ -2,7 +2,7 @@ describe('wrap <WorkspaceControlPanelButtons> by a plugin', () => {
beforeAll(async () => { beforeAll(async () => {
await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/plugins/wrap.html'); await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/plugins/wrap.html');
await expect(page).toMatchElement('.mirador-viewer'); await expect(page).toMatchElement('.mirador-viewer');
await page.waitFor(1000); await page.waitForTimeout(1000);
}); });
it('wraps <WorkspaceControlPanelButtons>', async () => { it('wraps <WorkspaceControlPanelButtons>', async () => {
......
...@@ -12,7 +12,7 @@ describe('Thumbnail navigation', () => { ...@@ -12,7 +12,7 @@ describe('Thumbnail navigation', () => {
miradorInstance.store.getState().windows miradorInstance.store.getState().windows
)); ));
expect(Object.values(windows)[0].canvasId).toBe('https://iiif.harvardartmuseums.org/manifests/object/299843/canvas/canvas-47174892'); // test harness in index.html starts at 2 expect(Object.values(windows)[0].canvasId).toBe('https://iiif.harvardartmuseums.org/manifests/object/299843/canvas/canvas-47174892'); // test harness in index.html starts at 2
await page.waitFor(1000); await page.waitForTimeout(1000);
await expect(page).toClick('.mirador-thumbnail-nav-canvas-1 img'); await expect(page).toClick('.mirador-thumbnail-nav-canvas-1 img');
await expect(page).toMatchElement('.mirador-thumbnail-nav-canvas-1.mirador-current-canvas-grouping', { timeout: 1500 }); await expect(page).toMatchElement('.mirador-thumbnail-nav-canvas-1.mirador-current-canvas-grouping', { timeout: 1500 });
windows = await page.evaluate(() => ( windows = await page.evaluate(() => (
......
...@@ -12,12 +12,12 @@ describe('Window actions', () => { ...@@ -12,12 +12,12 @@ describe('Window actions', () => {
await expect(page).toClick('[data-manifestid="http://127.0.0.1:4488/__tests__/fixtures/version-2/sn904cj3429.json"] button'); await expect(page).toClick('[data-manifestid="http://127.0.0.1:4488/__tests__/fixtures/version-2/sn904cj3429.json"] button');
await expect(page).toMatchElement('.mirador-window'); await expect(page).toMatchElement('.mirador-window');
await page.waitFor(1000); await page.waitForTimeout(1000);
await expect(page).toClick('.mirador-window-close'); await expect(page).toClick('.mirador-window-close');
const numWindows = await page.evaluate(page => ( const numWindows = await page.evaluate(page => (
document.querySelectorAll('.mirador-window').length document.querySelectorAll('.mirador-window').length
)); // only default configed windows found )); // only default configed windows found
await page.waitFor(1000); await page.waitForTimeout(1000);
await expect(numWindows).toBe(0); await expect(numWindows).toBe(0);
}); });
}); });
...@@ -20,7 +20,7 @@ describe('AccessTokenSender', () => { ...@@ -20,7 +20,7 @@ describe('AccessTokenSender', () => {
it('renders nothing if there is no url', () => { it('renders nothing if there is no url', () => {
wrapper = createWrapper({}); wrapper = createWrapper({});
expect(wrapper.matchesElement(<></>)).toBe(true); expect(wrapper.isEmptyRender()).toBe(true);
}); });
it('renders properly', () => { it('renders properly', () => {
......
...@@ -59,7 +59,7 @@ describe('LabelValueMetadata', () => { ...@@ -59,7 +59,7 @@ describe('LabelValueMetadata', () => {
it('renders an empty fragment instead of an empty dl', () => { it('renders an empty fragment instead of an empty dl', () => {
expect(wrapper.find('dl').length).toEqual(0); expect(wrapper.find('dl').length).toEqual(0);
expect(wrapper.matchesElement(<></>)).toBe(true); expect(wrapper.isEmptyRender()).toBe(true);
}); });
}); });
......
...@@ -11,7 +11,7 @@ import { MiradorMenuButton } from '../../../src/components/MiradorMenuButton'; ...@@ -11,7 +11,7 @@ import { MiradorMenuButton } from '../../../src/components/MiradorMenuButton';
function createWrapper(props) { function createWrapper(props) {
return shallow( return shallow(
<MiradorMenuButton aria-label="The Label" containerId="mirador" {...props}> <MiradorMenuButton aria-label="The Label" containerId="mirador" {...props}>
<>icon</> icon
</MiradorMenuButton>, </MiradorMenuButton>,
); );
} }
......
...@@ -13,11 +13,11 @@ import { NestedMenu } from '../../../src/components/NestedMenu'; ...@@ -13,11 +13,11 @@ import { NestedMenu } from '../../../src/components/NestedMenu';
function createWrapper(props) { function createWrapper(props) {
return shallow( return shallow(
<NestedMenu <NestedMenu
icon={<>GivenIcon</>} icon="GivenIcon"
label="GivenLabel" label="GivenLabel"
{...props} {...props}
> >
<>GivenChildren</> GivenChildren
</NestedMenu>, </NestedMenu>,
); );
} }
......
...@@ -10,15 +10,11 @@ const canvases = Utils.parseManifest(fixture).getSequences()[0].getCanvases(); ...@@ -10,15 +10,11 @@ const canvases = Utils.parseManifest(fixture).getSequences()[0].getCanvases();
jest.mock('openseadragon'); jest.mock('openseadragon');
describe('OpenSeadragonViewer', () => { /**
let wrapper; * Helper function to create a shallow wrapper around OpenSeadragonViewer
let updateViewport; */
beforeEach(() => { function createWrapper(props) {
OpenSeadragon.mockClear(); return shallow(
updateViewport = jest.fn();
wrapper = shallow(
<OpenSeadragonViewer <OpenSeadragonViewer
classes={{}} classes={{}}
infoResponses={[{ infoResponses={[{
...@@ -42,14 +38,24 @@ describe('OpenSeadragonViewer', () => { ...@@ -42,14 +38,24 @@ describe('OpenSeadragonViewer', () => {
}]} }]}
windowId="base" windowId="base"
config={{}} config={{}}
updateViewport={updateViewport} updateViewport={jest.fn()}
t={k => k} t={k => k}
canvasWorld={new CanvasWorld(canvases)} canvasWorld={new CanvasWorld(canvases)}
{...props}
> >
<div className="foo" /> <div className="foo" />
<div className="bar" /> <div className="bar" />
</OpenSeadragonViewer>, </OpenSeadragonViewer>,
); );
}
describe('OpenSeadragonViewer', () => {
let wrapper;
let updateViewport;
beforeEach(() => {
OpenSeadragon.mockClear();
wrapper = createWrapper({});
updateViewport = wrapper.instance().props.updateViewport;
}); });
it('renders the component', () => { it('renders the component', () => {
expect(wrapper.find('.mirador-osd-container').length).toBe(1); expect(wrapper.find('.mirador-osd-container').length).toBe(1);
...@@ -70,10 +76,7 @@ describe('OpenSeadragonViewer', () => { ...@@ -70,10 +76,7 @@ describe('OpenSeadragonViewer', () => {
expect(wrapper.instance().infoResponsesMatch([])).toBe(false); expect(wrapper.instance().infoResponsesMatch([])).toBe(false);
}); });
it('with an empty array', () => { it('with an empty array', () => {
wrapper.instance().viewer = { wrapper = createWrapper({ infoResponses: [] });
close: () => {},
};
wrapper.setProps({ infoResponses: [] });
expect(wrapper.instance().infoResponsesMatch([])).toBe(true); expect(wrapper.instance().infoResponsesMatch([])).toBe(true);
}); });
it('when the @ids do match', () => { it('when the @ids do match', () => {
...@@ -87,7 +90,7 @@ describe('OpenSeadragonViewer', () => { ...@@ -87,7 +90,7 @@ describe('OpenSeadragonViewer', () => {
expect(wrapper.instance().infoResponsesMatch([{ id: 'a', json: { '@id': 'http://foo-degraded' } }])).toBe(false); expect(wrapper.instance().infoResponsesMatch([{ id: 'a', json: { '@id': 'http://foo-degraded' } }])).toBe(false);
}); });
it('when the id props match', () => { it('when the id props match', () => {
wrapper.setProps({ wrapper = createWrapper({
infoResponses: [{ infoResponses: [{
id: 'a', id: 'a',
json: { json: {
...@@ -106,10 +109,7 @@ describe('OpenSeadragonViewer', () => { ...@@ -106,10 +109,7 @@ describe('OpenSeadragonViewer', () => {
expect(wrapper.instance().nonTiledImagedMatch([])).toBe(false); expect(wrapper.instance().nonTiledImagedMatch([])).toBe(false);
}); });
it('with an empty array', () => { it('with an empty array', () => {
wrapper.instance().viewer = { wrapper = createWrapper({ nonTiledImages: [] });
close: () => {},
};
wrapper.setProps({ nonTiledImages: [] });
expect(wrapper.instance().nonTiledImagedMatch([])).toBe(true); expect(wrapper.instance().nonTiledImagedMatch([])).toBe(true);
}); });
it('when the ids do match', () => { it('when the ids do match', () => {
...@@ -118,21 +118,17 @@ describe('OpenSeadragonViewer', () => { ...@@ -118,21 +118,17 @@ describe('OpenSeadragonViewer', () => {
}); });
describe('addAllImageSources', () => { describe('addAllImageSources', () => {
it('calls addTileSource for every tileSources and then zoomsToWorld', () => { it('calls addTileSource for every tileSources and then zoomsToWorld', async () => {
wrapper.instance().viewer = { wrapper = createWrapper({ infoResponses: [1, 2, 3, 4] });
close: () => {}, wrapper.setState({ viewer: { viewport: { fitBounds: () => {} }, world: { getItemCount: () => 0 } } });
};
wrapper.setProps({ infoResponses: [1, 2, 3, 4] });
const mockAddTileSource = jest.fn(); const mockAddTileSource = jest.fn();
wrapper.instance().addTileSource = mockAddTileSource; wrapper.instance().addTileSource = mockAddTileSource;
wrapper.instance().addAllImageSources(); await wrapper.instance().addAllImageSources();
expect(mockAddTileSource).toHaveBeenCalledTimes(4); expect(mockAddTileSource).toHaveBeenCalledTimes(4);
}); });
it('calls addNonTileSource for every nonTiledImage and then zoomsToWorld', () => {
wrapper.instance().viewer = { it('calls addNonTileSource for every nonTiledImage and then zoomsToWorld', async () => {
close: () => {}, wrapper = createWrapper({
};
wrapper.setProps({
nonTiledImages: [ nonTiledImages: [
{ getProperty: () => 'Image' }, { getProperty: () => 'Image' },
{ getProperty: () => 'Image' }, { getProperty: () => 'Image' },
...@@ -140,22 +136,18 @@ describe('OpenSeadragonViewer', () => { ...@@ -140,22 +136,18 @@ describe('OpenSeadragonViewer', () => {
{ getProperty: () => 'Image' }, { getProperty: () => 'Image' },
], ],
}); });
const instance = wrapper.instance();
const mockAddNonTiledImage = jest.fn(); const mockAddNonTiledImage = jest.fn();
wrapper.instance().addNonTiledImage = mockAddNonTiledImage; wrapper.instance().addNonTiledImage = mockAddNonTiledImage;
wrapper.instance().addAllImageSources(); await instance.addAllImageSources();
expect(mockAddNonTiledImage).toHaveBeenCalledTimes(4); expect(mockAddNonTiledImage).toHaveBeenCalledTimes(4);
}); });
}); });
describe('addTileSource', () => { describe('addTileSource', () => {
it('calls addTiledImage asynchronously on the OSD viewer', async () => { it('when a viewer is not available, returns an unresolved Promise', () => (
wrapper.instance().addTileSource({}).then((event) => { expect(wrapper.instance().addTileSource({})).rejects.toBeUndefined()
expect(event).toBe('event'); ));
});
});
it('when a viewer is not available, returns an unresolved Promise', () => {
expect(wrapper.instance().addTileSource({})).toEqual(expect.any(Promise));
});
}); });
describe('addNonTiledImage', () => { describe('addNonTiledImage', () => {
...@@ -189,17 +181,15 @@ describe('OpenSeadragonViewer', () => { ...@@ -189,17 +181,15 @@ describe('OpenSeadragonViewer', () => {
layerIndexOfImageResource: i => 1 - i, layerIndexOfImageResource: i => 1 - i,
layerOpacityOfImageResource: i => 0.5, layerOpacityOfImageResource: i => 0.5,
}; };
wrapper.setProps({ canvasWorld }); wrapper = createWrapper({ canvasWorld });
wrapper.instance().loaded = true; wrapper.instance().loaded = true;
wrapper.setState({ wrapper.instance().state.viewer = {
viewer: {
world: { world: {
getItemAt: i => ({ setOpacity, source: { id: i } }), getItemAt: i => ({ setOpacity, source: { id: i } }),
getItemCount: () => 2, getItemCount: () => 2,
setItemIndex, setItemIndex,
}, },
}, };
});
wrapper.instance().refreshTileProperties(); wrapper.instance().refreshTileProperties();
...@@ -280,12 +270,8 @@ describe('OpenSeadragonViewer', () => { ...@@ -280,12 +270,8 @@ describe('OpenSeadragonViewer', () => {
it('calls the OSD viewport panTo and zoomTo with the component state', () => { it('calls the OSD viewport panTo and zoomTo with the component state', () => {
wrapper.instance().componentDidMount(); wrapper.instance().componentDidMount();
expect(panTo).toHaveBeenCalledWith( expect(panTo).toHaveBeenCalledWith({ x: 1, y: 0, zoom: 0.5 }, true);
{ x: 1, y: 0, zoom: 0.5 }, true, expect(zoomTo).toHaveBeenCalledWith(0.5, { x: 1, y: 0, zoom: 0.5 }, true);
);
expect(zoomTo).toHaveBeenCalledWith(
0.5, { x: 1, y: 0, zoom: 0.5 }, true,
);
}); });
it('adds animation-start/finish flag for rerendering performance', () => { it('adds animation-start/finish flag for rerendering performance', () => {
...@@ -340,12 +326,8 @@ describe('OpenSeadragonViewer', () => { ...@@ -340,12 +326,8 @@ describe('OpenSeadragonViewer', () => {
}, },
}); });
expect(panTo).toHaveBeenCalledWith( expect(panTo).toHaveBeenCalledWith(expect.objectContaining({ x: 1, y: 0, zoom: 0.5 }), false);
expect.objectContaining({ x: 1, y: 0, zoom: 0.5 }), false, expect(zoomTo).toHaveBeenCalledWith(0.5, expect.objectContaining({ x: 1, y: 0, zoom: 0.5 }), false);
);
expect(zoomTo).toHaveBeenCalledWith(
0.5, expect.objectContaining({ x: 1, y: 0, zoom: 0.5 }), false,
);
expect(setRotation).toHaveBeenCalledWith(90); expect(setRotation).toHaveBeenCalledWith(90);
expect(setFlip).toHaveBeenCalledWith(true); expect(setFlip).toHaveBeenCalledWith(true);
expect(forceRedraw).not.toHaveBeenCalled(); expect(forceRedraw).not.toHaveBeenCalled();
......
...@@ -10,7 +10,7 @@ function createWrapper(props) { ...@@ -10,7 +10,7 @@ function createWrapper(props) {
scrollTo scrollTo
{...props} {...props}
> >
<>Child Prop</> Child Prop
</ScrollTo>, </ScrollTo>,
); );
} }
......
...@@ -36,9 +36,7 @@ describe('SearchPanelControls', () => { ...@@ -36,9 +36,7 @@ describe('SearchPanelControls', () => {
const value = 'somestring'; const value = 'somestring';
wrapper.find(Autocomplete).prop('onChange')({}, { match: value }, {}); wrapper.find(Autocomplete).prop('onChange')({}, { match: value }, {});
expect(wrapper.state().search).toEqual(value); expect(wrapper.state().search).toEqual(value);
expect(fetchSearch).toHaveBeenCalledWith( expect(fetchSearch).toHaveBeenCalledWith('window', 'cw', 'http://example.com/search?q=somestring', 'somestring');
'window', 'cw', 'http://example.com/search?q=somestring', 'somestring',
);
}); });
it('renders a text input through the renderInput prop', () => { it('renders a text input through the renderInput prop', () => {
const wrapper = createWrapper(); const wrapper = createWrapper();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment