Skip to content
Snippets Groups Projects
Commit 8218a6b0 authored by Jack Reed's avatar Jack Reed Committed by Chris Beer
Browse files

Update signature of setCanvas fixes #3347

parent 4ded93d7
No related branches found
No related tags found
No related merge requests found
...@@ -62,6 +62,13 @@ describe('GalleryView', () => { ...@@ -62,6 +62,13 @@ describe('GalleryView', () => {
expect(focusOnCanvas).toHaveBeenCalled(); expect(focusOnCanvas).toHaveBeenCalled();
}); });
it('sets the canvas if the user hits a key (non-space or non-enter) while on a canvas', () => {
const setCanvas = jest.fn();
wrapper = createWrapper({ selected: true, setCanvas });
wrapper.find('div[role="button"]').first().simulate('keyUp', { key: 'd' });
expect(setCanvas).toHaveBeenCalledWith('http://iiif.io/api/presentation/2.0/example/fixtures/canvas/24/c1.json');
});
describe('on-demand annotation fetching', () => { describe('on-demand annotation fetching', () => {
it('fetches annotations', () => { it('fetches annotations', () => {
const requestCanvasAnnotations = jest.fn(); const requestCanvasAnnotations = jest.fn();
......
...@@ -65,7 +65,7 @@ export class GalleryViewThumbnail extends Component { ...@@ -65,7 +65,7 @@ export class GalleryViewThumbnail extends Component {
if (enterOrSpace) { if (enterOrSpace) {
focusOnCanvas(); focusOnCanvas();
} else { } else {
setCanvas(canvas.index, canvas.id); setCanvas(canvas.id);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment