From 6870055033b211026f71d98fe651148bbd373cf7 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Tue, 4 Apr 2017 11:19:45 -0700 Subject: [PATCH] [Testing] Test plugin installation --- src/MCTSpec.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/MCTSpec.js b/src/MCTSpec.js index 2161eecc8f..d2a2027182 100644 --- a/src/MCTSpec.js +++ b/src/MCTSpec.js @@ -26,13 +26,32 @@ define([ ], function (MCT, plugins) { describe("MCT", function () { var openmct; + var mockPlugin; + var mockPlugin2; beforeEach(function () { + mockPlugin = jasmine.createSpy('plugin'); + mockPlugin2 = jasmine.createSpy('plugin'); + openmct = new MCT(); + + openmct.install(mockPlugin); + openmct.install(mockPlugin2); }); it("exposes plugins", function () { expect(openmct.plugins).toEqual(plugins); }); + + describe("when started", function () { + beforeEach(function () { + openmct.start(); + }); + + it("calls plugins for configuration", function () { + expect(mockPlugin).toHaveBeenCalledWith(openmct); + expect(mockPlugin2).toHaveBeenCalledWith(openmct); + }); + }); }); });