openmct/platform/features/layout/test/elements/ImageProxySpec.js
Victor Woeltjen 0b2cd52433 [Fixed Position] Add image proxy
Add selection proxy for image elements to support image URL
dialog, WTD-881.
2015-02-23 18:28:30 -08:00

38 lines
1.2 KiB
JavaScript

/*global define,describe,it,expect,beforeEach,jasmine*/
define(
['../../src/elements/ImageProxy'],
function (ImageProxy) {
"use strict";
describe("A fixed position image proxy", function () {
var testElement,
testElements,
proxy;
beforeEach(function () {
testElement = {
x: 1,
y: 2,
width: 42,
height: 24,
url: "http://www.nasa.gov"
};
testElements = [ {}, {}, testElement, {} ];
proxy = new ImageProxy(
testElement,
testElements.indexOf(testElement),
testElements
);
});
it("provides getter/setter for image URL", function () {
expect(proxy.url()).toEqual("http://www.nasa.gov");
expect(proxy.url("http://www.nasa.gov/some.jpg"))
.toEqual("http://www.nasa.gov/some.jpg");
expect(proxy.url()).toEqual("http://www.nasa.gov/some.jpg");
});
});
}
);