Commit ef7a99e1 authored by Robert Knight's avatar Robert Knight

Add test case for "showAnnotations" when annotation IDs cannot be found

This can happen if the annotations indicated by the tags have not been
saved or, less commonly, if they were deleted immediately before the
request was received.
parent d47d16ca
......@@ -684,6 +684,14 @@ describe('FrameSyncService', () => {
);
assert.calledWith(fakeStore.setAnnotationFocusRequest, 'id1');
});
it('does not request keyboard focus if no IDs could be found for annotation', () => {
// Simulate no IDs being found. This could happen if annotations are not
// saved or have been deleted since the request was sent.
fakeStore.findIDsForTags.returns([]);
emitGuestEvent('showAnnotations', ['tag1'], true /* focus */);
assert.notCalled(fakeStore.setAnnotationFocusRequest);
});
});
describe('on "hoverAnnotations" message', () => {
......
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