Commit 50d3fe44 authored by Robert Knight's avatar Robert Knight

Add missing test for `scrollToAnnotation` event for an anchor with no highlights

parent 9bec434d
......@@ -325,6 +325,15 @@ describe('Guest', () => {
assert.notCalled(fakeHTMLIntegration.scrollToAnchor);
});
it('does nothing if the anchor has no highlights', () => {
const guest = createGuest();
guest.anchors = [{ annotation: { $tag: 'tag1' } }];
emitGuestEvent('scrollToAnnotation', 'tag1');
assert.notCalled(fakeHTMLIntegration.scrollToAnchor);
});
it("does nothing if the anchor's range cannot be resolved", () => {
const highlight = document.createElement('span');
const guest = createGuest();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment