Skip to content

Commit

Permalink
Make OSD viewer test compatible with OSD 2.4.2
Browse files Browse the repository at this point in the history
Tests would previously fail if OSD version 2.4.2 was installed.
See  #3792
  • Loading branch information
lutzhelm authored and cbeer committed Nov 1, 2023
1 parent 5a95d44 commit 222378a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions __tests__/src/components/OpenSeadragonViewer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { cloneElement } from 'react';
import { render, screen, waitFor } from 'test-utils';
import PropTypes from 'prop-types';
import userEvent from '@testing-library/user-event';
import OpenSeadragon from 'openseadragon';
import { Utils } from 'manifesto.js';
import { OpenSeadragonViewer } from '../../../src/components/OpenSeadragonViewer';
import CanvasWorld from '../../../src/lib/CanvasWorld';
import fixture from '../../fixtures/version-2/019.json';
import { OSDReferences } from '../../../src/plugins/OSDReferences';

const canvases = Utils.parseManifest(fixture).getSequences()[0].getCanvases();

Expand Down Expand Up @@ -56,7 +56,7 @@ function createWrapper(props) {

const rendered = render(component);

const viewer = OpenSeadragon.getViewer(screen.getByLabelText('item'));
const viewer = OSDReferences.get('base').current;

return { ...rendered, component, viewer };
}
Expand Down

0 comments on commit 222378a

Please sign in to comment.