mirror of
https://github.com/nasa/openmct.git
synced 2024-12-30 09:58:52 +00:00
cab259415d
Test controller for WTD-1145.
38 lines
1.0 KiB
JavaScript
38 lines
1.0 KiB
JavaScript
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
|
|
|
|
define(
|
|
["../src/EmbeddedPageController"],
|
|
function (EmbeddedPageController) {
|
|
"use strict";
|
|
|
|
describe("The controller for embedded pages", function () {
|
|
var mockSCE,
|
|
controller;
|
|
|
|
beforeEach(function () {
|
|
mockSCE = jasmine.createSpyObj(
|
|
'$sce',
|
|
["trustAsResourceUrl"]
|
|
);
|
|
|
|
mockSCE.trustAsResourceUrl.andCallFake(function (v) {
|
|
return v;
|
|
});
|
|
|
|
controller = new EmbeddedPageController(mockSCE)
|
|
});
|
|
|
|
it("allows URLs to be marked as trusted", function () {
|
|
var testURL = "http://www.nasa.gov";
|
|
|
|
expect(controller.trust(testURL))
|
|
.toEqual(testURL);
|
|
|
|
expect(mockSCE.trustAsResourceUrl)
|
|
.toHaveBeenCalledWith(testURL);
|
|
});
|
|
|
|
});
|
|
}
|
|
);
|