Commit 9c2a6849 authored by Robert Knight's avatar Robert Knight

Improve test coverage of real time updates store module

 - Add missing `addPendingUpdates` call. The test was previously not
   checking what it was supposed to check
 - Improve a test for the `pendingUpdateCount` selector
parent 7b93744d
......@@ -69,6 +69,7 @@ describe('sidebar/store/modules/real-time-updates', () => {
it("does not add pending updates if the focused group does not match the annotation's group", () => {
fakeFocusedGroupId.returns('other-group');
addPendingUpdates(store);
assert.deepEqual(store.pendingUpdates(), {});
});
......@@ -136,8 +137,11 @@ describe('sidebar/store/modules/real-time-updates', () => {
it('clears pending updates when annotations are removed', () => {
const updates = addPendingUpdates(store);
store.dispatch(removeAnnotations(updates));
assert.deepEqual(store.pendingUpdateCount(), 0);
const deletions = addPendingDeletions(store);
store.dispatch(removeAnnotations([...updates, ...deletions]));
assert.equal(store.pendingUpdateCount(), 0);
});
it('clears pending updates when focused group changes', () => {
......
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