forked from reapp/scroller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinitialization.js
39 lines (33 loc) · 1.28 KB
/
initialization.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
var Scroller = require('../lib/Scroller');
var assert = require('assert');
describe("Initialization", function () {
it("should construct scroller objects", function() {
var scroller1 = new Scroller();
assert.equal(typeof scroller1, "object");
var scroller2 = new Scroller(function(left, top, zoom) {});
assert.equal(typeof scroller2, "object");
var scroller3 = new Scroller(null, {
scrollingY: false
});
assert.equal(typeof scroller3, "object");
var scroller4 = new Scroller(function(left, top, zoom) {}, {
scrollingY: false
});
assert.equal(typeof scroller4, "object");
});
it("should accept dimensions", function() {
var scroller = new Scroller();
assert.equal(typeof scroller, "object");
scroller.setDimensions(1000, 600, 5000, 5000);
});
it("should recall accepted dimensions", function() {
var scroller = new Scroller();
assert.equal(typeof scroller, "object");
scroller.setDimensions(1000, 600, 5000, 5000);
var values = scroller.getValues();
assert.equal(typeof values, "object");
assert.equal(values.left, 0);
assert.equal(values.top, 0);
assert.equal(values.zoom, 1);
});
});