Transformed
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
|
||||
|
||||
goog.require('ol.dom');
|
||||
import _ol_dom_ from '../../../../src/ol/dom.js';
|
||||
|
||||
describe('ol.dom', function() {
|
||||
|
||||
@@ -11,7 +9,7 @@ describe('ol.dom', function() {
|
||||
var defaultHeight = 150;
|
||||
|
||||
it('returns a CanvasRenderingContext2D', function() {
|
||||
var ctx = ol.dom.createCanvasContext2D();
|
||||
var ctx = _ol_dom_.createCanvasContext2D();
|
||||
expect(ctx).to.be.a(CanvasRenderingContext2D);
|
||||
expect(ctx.canvas).to.be.a(HTMLCanvasElement);
|
||||
expect(ctx.canvas.width).to.be(defaultWidth);
|
||||
@@ -19,7 +17,7 @@ describe('ol.dom', function() {
|
||||
});
|
||||
|
||||
it('has the desired width', function() {
|
||||
var ctx = ol.dom.createCanvasContext2D(42);
|
||||
var ctx = _ol_dom_.createCanvasContext2D(42);
|
||||
expect(ctx).to.be.a(CanvasRenderingContext2D);
|
||||
expect(ctx.canvas).to.be.a(HTMLCanvasElement);
|
||||
expect(ctx.canvas.width).to.be(42);
|
||||
@@ -27,7 +25,7 @@ describe('ol.dom', function() {
|
||||
});
|
||||
|
||||
it('has the desired height', function() {
|
||||
var ctx = ol.dom.createCanvasContext2D(undefined, 42);
|
||||
var ctx = _ol_dom_.createCanvasContext2D(undefined, 42);
|
||||
expect(ctx).to.be.a(CanvasRenderingContext2D);
|
||||
expect(ctx.canvas).to.be.a(HTMLCanvasElement);
|
||||
expect(ctx.canvas.width).to.be(defaultWidth);
|
||||
@@ -35,7 +33,7 @@ describe('ol.dom', function() {
|
||||
});
|
||||
|
||||
it('has the desired height and width', function() {
|
||||
var ctx = ol.dom.createCanvasContext2D(42, 42);
|
||||
var ctx = _ol_dom_.createCanvasContext2D(42, 42);
|
||||
expect(ctx).to.be.a(CanvasRenderingContext2D);
|
||||
expect(ctx.canvas).to.be.a(HTMLCanvasElement);
|
||||
expect(ctx.canvas.width).to.be(42);
|
||||
@@ -63,7 +61,7 @@ describe('ol.dom', function() {
|
||||
describe('without padding, margin or border', function() {
|
||||
|
||||
it('calculates correctly', function() {
|
||||
var calcWidth = ol.dom.outerWidth(element);
|
||||
var calcWidth = _ol_dom_.outerWidth(element);
|
||||
expect(calcWidth).to.be(10);
|
||||
});
|
||||
|
||||
@@ -72,13 +70,13 @@ describe('ol.dom', function() {
|
||||
describe('with padding', function() {
|
||||
it('calculates correctly (both sides)', function() {
|
||||
element.style.padding = '5px';
|
||||
var calcWidth = ol.dom.outerWidth(element);
|
||||
var calcWidth = _ol_dom_.outerWidth(element);
|
||||
expect(calcWidth).to.be(20);
|
||||
});
|
||||
|
||||
it('calculates correctly (one side)', function() {
|
||||
element.style.paddingLeft = '5px';
|
||||
var calcWidth = ol.dom.outerWidth(element);
|
||||
var calcWidth = _ol_dom_.outerWidth(element);
|
||||
expect(calcWidth).to.be(15);
|
||||
});
|
||||
});
|
||||
@@ -87,13 +85,13 @@ describe('ol.dom', function() {
|
||||
|
||||
it('calculates correctly (both sides)', function() {
|
||||
element.style.margin = '5px';
|
||||
var calcWidth = ol.dom.outerWidth(element);
|
||||
var calcWidth = _ol_dom_.outerWidth(element);
|
||||
expect(calcWidth).to.be(20);
|
||||
});
|
||||
|
||||
it('calculates correctly (one side)', function() {
|
||||
element.style.marginLeft = '5px';
|
||||
var calcWidth = ol.dom.outerWidth(element);
|
||||
var calcWidth = _ol_dom_.outerWidth(element);
|
||||
expect(calcWidth).to.be(15);
|
||||
});
|
||||
|
||||
@@ -103,14 +101,14 @@ describe('ol.dom', function() {
|
||||
|
||||
it('calculates correctly (both sides)', function() {
|
||||
element.style.border = '5px solid chocolate';
|
||||
var calcWidth = ol.dom.outerWidth(element);
|
||||
var calcWidth = _ol_dom_.outerWidth(element);
|
||||
expect(calcWidth).to.be(20);
|
||||
});
|
||||
|
||||
it('calculates correctly (one side)', function() {
|
||||
element.style.border = '5px solid chocolate';
|
||||
element.style.borderRightWidth = '0';
|
||||
var calcWidth = ol.dom.outerWidth(element);
|
||||
var calcWidth = _ol_dom_.outerWidth(element);
|
||||
expect(calcWidth).to.be(15);
|
||||
});
|
||||
|
||||
@@ -121,14 +119,14 @@ describe('ol.dom', function() {
|
||||
it('calculates correctly (both sides)', function() {
|
||||
element.style.padding = '5px';
|
||||
element.style.margin = '5px';
|
||||
var calcWidth = ol.dom.outerWidth(element);
|
||||
var calcWidth = _ol_dom_.outerWidth(element);
|
||||
expect(calcWidth).to.be(30);
|
||||
});
|
||||
|
||||
it('calculates correctly (one side)', function() {
|
||||
element.style.paddingLeft = '5px';
|
||||
element.style.marginLeft = '5px';
|
||||
var calcWidth = ol.dom.outerWidth(element);
|
||||
var calcWidth = _ol_dom_.outerWidth(element);
|
||||
expect(calcWidth).to.be(20);
|
||||
});
|
||||
|
||||
@@ -139,7 +137,7 @@ describe('ol.dom', function() {
|
||||
it('calculates correctly (both sides)', function() {
|
||||
element.style.padding = '5px';
|
||||
element.style.border = '5px solid chocolate';
|
||||
var calcWidth = ol.dom.outerWidth(element);
|
||||
var calcWidth = _ol_dom_.outerWidth(element);
|
||||
expect(calcWidth).to.be(30);
|
||||
});
|
||||
|
||||
@@ -147,7 +145,7 @@ describe('ol.dom', function() {
|
||||
element.style.paddingLeft = '5px';
|
||||
element.style.border = '5px solid chocolate';
|
||||
element.style.borderRightWidth = '0';
|
||||
var calcWidth = ol.dom.outerWidth(element);
|
||||
var calcWidth = _ol_dom_.outerWidth(element);
|
||||
expect(calcWidth).to.be(20);
|
||||
});
|
||||
|
||||
@@ -158,7 +156,7 @@ describe('ol.dom', function() {
|
||||
it('calculates correctly (both sides)', function() {
|
||||
element.style.margin = '5px';
|
||||
element.style.border = '5px solid chocolate';
|
||||
var calcWidth = ol.dom.outerWidth(element);
|
||||
var calcWidth = _ol_dom_.outerWidth(element);
|
||||
expect(calcWidth).to.be(30);
|
||||
});
|
||||
|
||||
@@ -166,7 +164,7 @@ describe('ol.dom', function() {
|
||||
element.style.marginLeft = '5px';
|
||||
element.style.border = '5px solid chocolate';
|
||||
element.style.borderRightWidth = '0';
|
||||
var calcWidth = ol.dom.outerWidth(element);
|
||||
var calcWidth = _ol_dom_.outerWidth(element);
|
||||
expect(calcWidth).to.be(20);
|
||||
});
|
||||
|
||||
@@ -178,7 +176,7 @@ describe('ol.dom', function() {
|
||||
element.style.margin = '5px';
|
||||
element.style.padding = '5px';
|
||||
element.style.border = '5px solid chocolate';
|
||||
var calcWidth = ol.dom.outerWidth(element);
|
||||
var calcWidth = _ol_dom_.outerWidth(element);
|
||||
expect(calcWidth).to.be(40);
|
||||
});
|
||||
|
||||
@@ -187,7 +185,7 @@ describe('ol.dom', function() {
|
||||
element.style.paddingLeft = '5px';
|
||||
element.style.border = '5px solid chocolate';
|
||||
element.style.borderRightWidth = '0';
|
||||
var calcWidth = ol.dom.outerWidth(element);
|
||||
var calcWidth = _ol_dom_.outerWidth(element);
|
||||
expect(calcWidth).to.be(25);
|
||||
});
|
||||
|
||||
@@ -214,7 +212,7 @@ describe('ol.dom', function() {
|
||||
describe('without padding, margin or border', function() {
|
||||
|
||||
it('calculates correctly', function() {
|
||||
var calcHeight = ol.dom.outerHeight(element);
|
||||
var calcHeight = _ol_dom_.outerHeight(element);
|
||||
expect(calcHeight).to.be(10);
|
||||
});
|
||||
|
||||
@@ -223,13 +221,13 @@ describe('ol.dom', function() {
|
||||
describe('with padding', function() {
|
||||
it('calculates correctly (both sides)', function() {
|
||||
element.style.padding = '5px';
|
||||
var calcHeight = ol.dom.outerHeight(element);
|
||||
var calcHeight = _ol_dom_.outerHeight(element);
|
||||
expect(calcHeight).to.be(20);
|
||||
});
|
||||
|
||||
it('calculates correctly (one side)', function() {
|
||||
element.style.paddingTop = '5px';
|
||||
var calcHeight = ol.dom.outerHeight(element);
|
||||
var calcHeight = _ol_dom_.outerHeight(element);
|
||||
expect(calcHeight).to.be(15);
|
||||
});
|
||||
});
|
||||
@@ -238,13 +236,13 @@ describe('ol.dom', function() {
|
||||
|
||||
it('calculates correctly (both sides)', function() {
|
||||
element.style.margin = '5px';
|
||||
var calcHeight = ol.dom.outerHeight(element);
|
||||
var calcHeight = _ol_dom_.outerHeight(element);
|
||||
expect(calcHeight).to.be(20);
|
||||
});
|
||||
|
||||
it('calculates correctly (one side)', function() {
|
||||
element.style.marginTop = '5px';
|
||||
var calcHeight = ol.dom.outerHeight(element);
|
||||
var calcHeight = _ol_dom_.outerHeight(element);
|
||||
expect(calcHeight).to.be(15);
|
||||
});
|
||||
|
||||
@@ -254,14 +252,14 @@ describe('ol.dom', function() {
|
||||
|
||||
it('calculates correctly (both sides)', function() {
|
||||
element.style.border = '5px solid chocolate';
|
||||
var calcHeight = ol.dom.outerHeight(element);
|
||||
var calcHeight = _ol_dom_.outerHeight(element);
|
||||
expect(calcHeight).to.be(20);
|
||||
});
|
||||
|
||||
it('calculates correctly (one side)', function() {
|
||||
element.style.border = '5px solid chocolate';
|
||||
element.style.borderBottomWidth = '0';
|
||||
var calcHeight = ol.dom.outerHeight(element);
|
||||
var calcHeight = _ol_dom_.outerHeight(element);
|
||||
expect(calcHeight).to.be(15);
|
||||
});
|
||||
|
||||
@@ -272,14 +270,14 @@ describe('ol.dom', function() {
|
||||
it('calculates correctly (both sides)', function() {
|
||||
element.style.padding = '5px';
|
||||
element.style.margin = '5px';
|
||||
var calcHeight = ol.dom.outerHeight(element);
|
||||
var calcHeight = _ol_dom_.outerHeight(element);
|
||||
expect(calcHeight).to.be(30);
|
||||
});
|
||||
|
||||
it('calculates correctly (one side)', function() {
|
||||
element.style.paddingTop = '5px';
|
||||
element.style.marginTop = '5px';
|
||||
var calcHeight = ol.dom.outerHeight(element);
|
||||
var calcHeight = _ol_dom_.outerHeight(element);
|
||||
expect(calcHeight).to.be(20);
|
||||
});
|
||||
|
||||
@@ -290,7 +288,7 @@ describe('ol.dom', function() {
|
||||
it('calculates correctly (both sides)', function() {
|
||||
element.style.padding = '5px';
|
||||
element.style.border = '5px solid chocolate';
|
||||
var calcHeight = ol.dom.outerHeight(element);
|
||||
var calcHeight = _ol_dom_.outerHeight(element);
|
||||
expect(calcHeight).to.be(30);
|
||||
});
|
||||
|
||||
@@ -298,7 +296,7 @@ describe('ol.dom', function() {
|
||||
element.style.paddingTop = '5px';
|
||||
element.style.border = '5px solid chocolate';
|
||||
element.style.borderBottomWidth = '0';
|
||||
var calcHeight = ol.dom.outerHeight(element);
|
||||
var calcHeight = _ol_dom_.outerHeight(element);
|
||||
expect(calcHeight).to.be(20);
|
||||
});
|
||||
|
||||
@@ -309,7 +307,7 @@ describe('ol.dom', function() {
|
||||
it('calculates correctly (both sides)', function() {
|
||||
element.style.margin = '5px';
|
||||
element.style.border = '5px solid chocolate';
|
||||
var calcHeight = ol.dom.outerHeight(element);
|
||||
var calcHeight = _ol_dom_.outerHeight(element);
|
||||
expect(calcHeight).to.be(30);
|
||||
});
|
||||
|
||||
@@ -317,7 +315,7 @@ describe('ol.dom', function() {
|
||||
element.style.marginTop = '5px';
|
||||
element.style.border = '5px solid chocolate';
|
||||
element.style.borderBottomWidth = '0';
|
||||
var calcHeight = ol.dom.outerHeight(element);
|
||||
var calcHeight = _ol_dom_.outerHeight(element);
|
||||
expect(calcHeight).to.be(20);
|
||||
});
|
||||
|
||||
@@ -329,7 +327,7 @@ describe('ol.dom', function() {
|
||||
element.style.margin = '5px';
|
||||
element.style.padding = '5px';
|
||||
element.style.border = '5px solid chocolate';
|
||||
var calcHeight = ol.dom.outerHeight(element);
|
||||
var calcHeight = _ol_dom_.outerHeight(element);
|
||||
expect(calcHeight).to.be(40);
|
||||
});
|
||||
|
||||
@@ -338,7 +336,7 @@ describe('ol.dom', function() {
|
||||
element.style.paddingTop = '5px';
|
||||
element.style.border = '5px solid chocolate';
|
||||
element.style.borderBottomWidth = '0';
|
||||
var calcHeight = ol.dom.outerHeight(element);
|
||||
var calcHeight = _ol_dom_.outerHeight(element);
|
||||
expect(calcHeight).to.be(25);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user