[Edit] Avoid extra commits

Avoid issuing extra commit calls from the Edit toolbar;
this can cause disruption of state from other views (such
as Fixed Position), WTD-881.
This commit is contained in:
Victor Woeltjen
2015-02-24 09:47:00 -08:00
parent 3d86871c1d
commit 1e76264d82
4 changed files with 56 additions and 6 deletions

View File

@ -143,6 +143,15 @@ define(
expect(testABC.a).toHaveBeenCalledWith("new value");
});
it("provides a return value describing update status", function () {
// Should return true if actually updated, otherwise false
var key;
toolbar.setSelection([ testABC ]);
key = toolbar.getStructure().sections[0].items[0].key;
expect(toolbar.updateState(key, testABC.a)).toBeFalsy();
expect(toolbar.updateState(key, "new value")).toBeTruthy();
});
it("removes inapplicable items", function () {
// First, verify with all items
toolbar.setSelection([ testABC ]);