[Fixed Position] Add fill properties

Add 'fill' properties, to allow specifying background
color in Fixed Position view. WTD-881.
This commit is contained in:
Victor Woeltjen
2015-02-23 10:48:44 -08:00
parent 53aabd5743
commit 182d02599d
7 changed files with 158 additions and 5 deletions

View File

@@ -0,0 +1,36 @@
/*global define,describe,it,expect,beforeEach,jasmine*/
define(
['../../src/elements/BoxProxy'],
function (BoxProxy) {
"use strict";
describe("A fixed position box proxy", function () {
var testElement,
testElements,
proxy;
beforeEach(function () {
testElement = {
x: 1,
y: 2,
width: 42,
height: 24,
fill: "transparent"
};
testElements = [ {}, {}, testElement, {} ];
proxy = new BoxProxy(
testElement,
testElements.indexOf(testElement),
testElements
);
});
it("provides getter/setter for fill color", function () {
expect(proxy.fill()).toEqual('transparent');
expect(proxy.fill('#FFF')).toEqual('#FFF');
expect(proxy.fill()).toEqual('#FFF');
});
});
}
);

View File

@@ -0,0 +1,36 @@
/*global define,describe,it,expect,beforeEach,jasmine*/
define(
['../../src/elements/TextProxy'],
function (TextProxy) {
"use strict";
describe("A fixed position text proxy", function () {
var testElement,
testElements,
proxy;
beforeEach(function () {
testElement = {
x: 1,
y: 2,
width: 42,
height: 24,
fill: "transparent"
};
testElements = [ {}, {}, testElement, {} ];
proxy = new TextProxy(
testElement,
testElements.indexOf(testElement),
testElements
);
});
it("provides getter/setter for fill color", function () {
expect(proxy.fill()).toEqual('transparent');
expect(proxy.fill('#FFF')).toEqual('#FFF');
expect(proxy.fill()).toEqual('#FFF');
});
});
}
);