From 2a4004fd5bcddc8249c8911606d14dad8303d14b Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Thu, 19 May 2016 15:09:52 -0700 Subject: [PATCH] [Timeline] Test mct-representation ordering Verify that a configuration object has been added to scope before changing templates. #908 --- .../representation/test/MCTRepresentationSpec.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/platform/representation/test/MCTRepresentationSpec.js b/platform/representation/test/MCTRepresentationSpec.js index 52d6c70d55..d3ccd61a7b 100644 --- a/platform/representation/test/MCTRepresentationSpec.js +++ b/platform/representation/test/MCTRepresentationSpec.js @@ -194,6 +194,21 @@ define( .toHaveBeenCalledWith(testViews[1]); }); + it("exposes configuration before changing templates", function () { + var observedConfiguration; + + mockChangeTemplate.andCallFake(function () { + observedConfiguration = mockScope.configuration; + }); + + mockScope.key = "xyz"; + mockScope.domainObject = mockDomainObject; + fireWatch('key', mockScope.key); + fireWatch('domainObject', mockDomainObject); + + expect(observedConfiguration).toBeDefined(); + }); + it("does not load templates until there is an object", function () { mockScope.key = "xyz";