mirror of
https://github.com/nasa/openmct.git
synced 2024-12-24 15:26:39 +00:00
3cfcd027e0
Fill in specs for fixed position views selection proxies, WTD-879.
42 lines
1.2 KiB
JavaScript
42 lines
1.2 KiB
JavaScript
/*global define,describe,it,expect,beforeEach,jasmine*/
|
|
|
|
define(
|
|
['../../src/elements/ElementProxy'],
|
|
function (ElementProxy) {
|
|
"use strict";
|
|
|
|
describe("A fixed position element proxy", function () {
|
|
var testElement,
|
|
testElements,
|
|
proxy;
|
|
|
|
beforeEach(function () {
|
|
testElement = {
|
|
x: 1,
|
|
y: 2,
|
|
z: 3,
|
|
width: 42,
|
|
height: 24
|
|
};
|
|
testElements = [ {}, {}, testElement, {} ];
|
|
proxy = new ElementProxy(
|
|
testElement,
|
|
testElements.indexOf(testElement),
|
|
testElements
|
|
);
|
|
});
|
|
|
|
it("exposes element properties", function () {
|
|
Object.keys(testElement).forEach(function (k) {
|
|
expect(proxy[k]()).toEqual(testElement[k]);
|
|
});
|
|
});
|
|
|
|
it("allows elements to be removed", function () {
|
|
proxy.remove();
|
|
expect(testElements).toEqual([{}, {}, {}]);
|
|
});
|
|
});
|
|
}
|
|
);
|