diff --git a/platform/representation/test/TemplateLinkerSpec.js b/platform/representation/test/TemplateLinkerSpec.js index 726e4deab1..2db92a42d7 100644 --- a/platform/representation/test/TemplateLinkerSpec.js +++ b/platform/representation/test/TemplateLinkerSpec.js @@ -44,6 +44,16 @@ define( mockPromise, linker; + function testExtension(path, res, templatePath) { + return { + bundle: { + path: path, + resources: res + }, + templateUrl: templatePath + }; + } + beforeEach(function () { mockTemplateRequest = jasmine.createSpy('$templateRequest'); mockSce = jasmine.createSpyObj('$sce', ['trustAsResourceUrl']); @@ -91,13 +101,8 @@ define( }); it("resolves extension paths", function () { - expect(linker.getPath({ - bundle: { - path: 'a', - resources: 'b' - }, - templateUrl: 'c/d.html' - })).toEqual('a/b/c/d.html'); + var testExt = testExtension('a', 'b', 'c/d.html'); + expect(linker.getPath(testExt)).toEqual('a/b/c/d.html'); }); describe("when linking elements", function () { @@ -132,13 +137,15 @@ define( }); describe("and then changing templates", function () { - var testUrl, + var testExt, + testUrl, testTemplate; beforeEach(function () { - testUrl = "some/url/template.html"; + testExt = testExtension('some', 'url', 'template.html'); + testUrl = linker.getPath(testExt); testTemplate = "