forked from telerik/kendo-ui-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwrap.js
60 lines (40 loc) · 1.48 KB
/
wrap.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
(function(){
var span;
describe("wrap", function () {
beforeEach(function() {
span = $("<span style='display: block;'>foo</span>").appendTo(Mocha.fixture);
});
it("container with pixel width produces wrapper with pixel width", function() {
span.width("50px");
var wrap = kendo.wrap(span);
assert.isOk(wrap[0].style.width == "50px");
assert.isOk(wrap.children()[0].style.width == "50px");
});
it("container with pixel height produces wrapper with pixel height", function() {
span.height("50px");
var wrap = kendo.wrap(span);
assert.isOk(wrap[0].style.height == "50px");
assert.isOk(wrap.children()[0].style.height == "50px");
});
it("updated container with pixel width updates wrapper pixel width", function() {
span.width("50px");
kendo.wrap(span);
span.width("60px");
var wrap = kendo.wrap(span);
assert.isOk(wrap[0].style.width == "60px");
assert.isOk(wrap.children()[0].style.width == "60px");
});
it("container with percent height produces wrapper with percent height", function() {
span.height("50%");
var wrap = kendo.wrap(span);
assert.isOk(wrap[0].style.height == "50%");
assert.isOk(wrap.children()[0].style.height == "100%");
});
it("container with percent width produces wrapper with percent width", function() {
span.width("50%");
var wrap = kendo.wrap(span);
assert.isOk(wrap[0].style.width == "50%");
assert.isOk(wrap.children()[0].style.width == "100%");
});
});
}());