Skip to content
This repository was archived by the owner on May 26, 2025. It is now read-only.

Commit ffc83b2

Browse files
committed
Improving tests for all browsers
1 parent 50bda89 commit ffc83b2

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

dom/animate/animate_test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,10 +1204,10 @@ steal('jquery/dom/animate',
12041204
setTimeout(function() {
12051205
// Clear the queue and stop
12061206
div.stop();
1207-
ok(div.height() < 100 * 0.95, 'Animation stopped before it reached full height');
1208-
ok(div.width() < 150 * 0.95, 'Animation stopped before it reached full width');
1207+
ok(div.height() < 100 * 0.95, 'Animation stopped at ' + div.height() + ' before it reached full height of 100');
1208+
ok(div.width() < 150 * 0.95, 'Animation stopped at ' + div.width() + ' before it reached full width of 150');
12091209
start();
1210-
}, 100);
1210+
}, 50);
12111211
});
12121212

12131213
/* As mentioned, thoroughly abuses undocumented methods. Since the overwritten animate doesn't

event/drag/drag_test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ test("drag position", function(){
131131

132132
Syn.drag("+20 +20","drag", function(){
133133
var offset2 = $('#drag').offset();
134-
equals(offset.top+20, Math.round(offset2.top), "top")
135-
equals(offset.left+20, Math.round(offset2.left), "left")
134+
equals(offset.top+20, Math.ceil(offset2.top), "top")
135+
equals(offset.left+20, Math.ceil(offset2.left), "left")
136136
start();
137137
})
138138
});
@@ -178,13 +178,13 @@ test("dragdown" , function(){
178178
stop();
179179
Syn.drag("+20 +20","draginp", function(){
180180
var offset2 = $('#dragger').offset();
181-
equals(offset.top, Math.round(offset2.top), "top")
182-
equals(offset.left, Math.round(offset2.left), "left")
181+
equals(offset.top, Math.ceil(offset2.top), "top")
182+
equals(offset.left, Math.ceil(offset2.left), "left")
183183

184184
}).drag("+20 +20","dragnoprevent", function(){
185185
var offset2 = $('#dragger').offset();
186-
equals(offset.top+20, offset2.top, "top")
187-
equals(offset.left+20, offset2.left, "left")
186+
equals(offset.top+20, Math.ceil(offset2.top), "top")
187+
equals(offset.left+20, Math.ceil(offset2.left), "left")
188188
// IE doesn't respect preventDefault on text inputs (http://www.quirksmode.org/dom/events/click.html)
189189
if(!$.browser.msie)
190190
ok(draginpfocused, "First input was allowed to be focused correctly");

0 commit comments

Comments
 (0)