8000 Add more tests. · f2er/jquery.transit@ce73938 · GitHub
[go: up one dir, main page]

Skip to content

Commit ce73938

Browse files
committed
Add more tests.
1 parent 69979a3 commit ce73938

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

site/test.haml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,7 @@ title: Your new Proton site
509509
// Super simple test framework.
510510
var T = {
511511
test: null,
512+
alerted: false,
512513

513514
run: function(tests) {
514515
var self = this;
@@ -519,15 +520,16 @@ title: Your new Proton site
519520
var fn = tests[test];
520521
var obj = {};
521522
if (tests._setup) tests._setup.apply(obj);
522-
fn.apply(obj, [ function(val) { self.assert(val, test); } ]);
523+
fn.apply(obj, [ function(val) { self.assert(val, test, this); } ]);
523524
}
524525
}
525526
},
526527

527-
assert: function(value, test) {
528+
assert: function(value, test, T) {
528529
if (!value) {
529530
console.error(test, "- Assertion failed.");
530531
console.trace();
532+
if (!T.alerted) alert("An assertion failed. See the console for details.");
531533
}
532534
}
533535
};
@@ -576,6 +578,20 @@ title: Your new Proton site
576578
a(this.div.css('translate') == ['300em','400em']);
577579
},
578580

581+
scale_1: function(a) {
582+
this.div.css('scale', [2,3]);
583+
var s = this.div.css('scale');
584+
585+
a(s.length == 2);
586+
a(s[0] == 2);
587+
a(s[1] == 3);
588+
},
589+
590+
scale_2: function(a) {
591+
this.div.css('scale', [2.5, 2.5]);
592+
a(this.div.css('scale') == 2.5);
593+
},
594+
579595
transform_object: function(a) {
580596
this.div.css('x', '40px');
581597
this.div.css('y', '90px');

0 commit comments

Comments
 (0)
0