From 5949580b0a393f4db2bd8df7d6b79863ef9757fd Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Tue, 27 Jan 2015 15:47:30 -0800 Subject: [PATCH] [Licenses] Add spec Add spec for the license controller (used to populate the template for the licenses page, WTD-669) to ensure code coverage. --- .../about/test/LicenseControllerSpec.js | 30 +++++++++++++++++++ platform/commonUI/about/test/suite.json | 1 + 2 files changed, 31 insertions(+) create mode 100644 platform/commonUI/about/test/LicenseControllerSpec.js diff --git a/platform/commonUI/about/test/LicenseControllerSpec.js b/platform/commonUI/about/test/LicenseControllerSpec.js new file mode 100644 index 0000000000..b7afe03b43 --- /dev/null +++ b/platform/commonUI/about/test/LicenseControllerSpec.js @@ -0,0 +1,30 @@ +/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/ + +define( + ['../src/LicenseController'], + function (LicenseController) { + "use strict"; + + describe("The License controller", function () { + var testLicenses, + controller; + + beforeEach(function () { + testLicenses = [ + { name: "A" }, + { name: "B" }, + { name: "C" } + ]; + controller = new LicenseController(testLicenses); + }); + + it("exposes license information", function () { + // LicenseController is just there to pass licenses[] + // extensions down to the template. + expect(controller.licenses()).toEqual(testLicenses); + }); + + }); + + } +); \ No newline at end of file diff --git a/platform/commonUI/about/test/suite.json b/platform/commonUI/about/test/suite.json index e626ff9b7a..7b3b90142a 100644 --- a/platform/commonUI/about/test/suite.json +++ b/platform/commonUI/about/test/suite.json @@ -1,4 +1,5 @@ [ "AboutController", + "LicenseController", "LogoController" ] \ No newline at end of file