]>
git.proxmox.com Git - extjs.git/blob - extjs/packages/core/test/specs/dom/Element_scroll.js
1 describe("Ext.dom.Element_scroll", function() {
10 function expectLeft(left
) {
11 expect(el
.dom
.scrollLeft
).toBe(left
);
14 function expectTop(top
) {
15 expect(el
.dom
.scrollTop
).toBe(top
);
18 function expectLeftTop(left
, top
) {
23 describe("scroll", function() {
24 var scrollSize
= Ext
.getScrollbarSize(),
25 maxHorz
= 600 + scrollSize
.width
,
26 maxVert
= 600 + scrollSize
.height
;
28 beforeEach(function(){
29 el
= Ext
.getBody().createChild({
44 describe("right", function(){
45 it("should accept 'right' as a param", function(){
46 el
.scroll('right', 200);
50 it("should accept 'r' as a param", function(){
55 it("should append to the current position", function(){
61 it("should constrain the max scroll", function(){
67 describe("left", function(){
68 it("should accept 'left' as a param", function(){
70 el
.scroll('left', 125);
74 it("should accept 'l' as a param", function(){
80 it("should append to the current position", function(){
87 it("should constrain to 0", function(){
94 describe("bottom", function(){
95 it("should accept 'bottom' as a param", function() {
96 el
.scroll('bottom', 30);
100 it("should accept 'b' as a param", function() {
105 it("should accept 'down' as a param", function() {
106 el
.scroll('down', 30);
110 it("should accept 'd' as a param", function() {
115 it("should append to the current position", function() {
121 it("should constrain the max scroll", function(){
122 el
.scroll('b', 1500);
127 describe("up", function(){
128 it("should accept 'up' as a param", function() {
134 it("should accept 'u' as a param", function() {
140 it("should accept 'top' as a param", function() {
142 el
.scroll('top', 130);
146 it("should accept 't' as a param", function() {
152 it("should append to the current position", function() {
159 it("should constrain the max scroll", function() {
161 el
.scroll('t', 3000);