[Representation] Refresh only capabilities on modified

When changes to a domain object's modification timestamp are
detected, refresh only the capabilities associated with that
domain object (instead of rebuilding the whole view.)
Specifically avoids latency when layout views are rebuilt,
WTD-716.
This commit is contained in:
Victor Woeltjen
2015-01-27 10:00:06 -08:00
parent 5c34382933
commit 0df809741a
2 changed files with 35 additions and 22 deletions

View File

@@ -115,7 +115,7 @@ define(
mockScope.key = "abc";
// Trigger the watch
mockScope.$watch.mostRecentCall.args[1]();
mockScope.$watch.calls[0].args[1]();
expect(mockScope.inclusion).toEqual("a/b/c/template.html");
});
@@ -126,7 +126,7 @@ define(
mockScope.key = "xyz";
// Trigger the watch
mockScope.$watch.mostRecentCall.args[1]();
mockScope.$watch.calls[0].args[1]();
expect(mockScope.inclusion).toEqual("x/y/z/template.html");
});
@@ -138,7 +138,7 @@ define(
mockScope.domainObject = mockDomainObject;
// Trigger the watch
mockScope.$watch.mostRecentCall.args[1]();
mockScope.$watch.calls[0].args[1]();
expect(mockDomainObject.useCapability)
.toHaveBeenCalledWith("testCapability");
@@ -155,7 +155,7 @@ define(
expect(mockLog.warn).not.toHaveBeenCalled();
// Trigger the watch
mockScope.$watch.mostRecentCall.args[1]();
mockScope.$watch.calls[0].args[1]();
// Should have gotten a warning - that's an unknown key
expect(mockLog.warn).toHaveBeenCalled();