Commit 4d0d4b7a authored by Robert Knight's avatar Robert Knight

Add test for error when quote fails to anchor in PDF

parent 370fe800
...@@ -212,6 +212,18 @@ describe('annotator.anchoring.pdf', function () { ...@@ -212,6 +212,18 @@ describe('annotator.anchoring.pdf', function () {
assert.equal(anchoredRange.toString(), 'Loading annotations…'); assert.equal(anchoredRange.toString(), 'Loading annotations…');
}); });
}); });
it('rejects if quote cannot be anchored', () => {
viewer.setCurrentPage(2);
const selectors = [{
type: 'TextQuoteSelector',
exact: 'phrase that does not exist in the PDF',
}];
return pdfAnchoring.anchor(container, selectors)
.catch(err => {
assert.equal(err.message, 'Quote not found');
});
});
}); });
}); });
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