forked from puppybits/QTransform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
unittest.html
123 lines (96 loc) · 3.59 KB
/
unittest.html
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<link rel="stylesheet"
href="http://github.com/jquery/qunit/raw/master/qunit/qunit.css"
type="text/css" media="screen" />
<script type="text/javascript"
src="http://github.com/jquery/qunit/raw/master/qunit/qunit.js"></script>
<script type="text/javascript"
src="QTransform.js"></script>
<script>
$(document).ready(function(){
module("Set Transform");
test("1 transform, 1 property", function() {
$('#transform').css('scaleX','3');
ok($('#transform').css('transform') === 'scaleX(3)',
'scaleX should be 3 was '+$('#transform').css('transform'));
});
test("1 transform, 2 properties at once", function() {
$('#transform').css('translate','3px');
ok($('#transform').css('transform') === 'translate(3px, 3px)' );
});
test("1 transform, 2 properties together", function() {
$('#transform').css('translate','3px, 5px');
ok($('#transform').css('transform') === 'translate(3px, 5px)' );
});
test("2 transform, 1 property", function() {
$('#transform').css({scaleX:3, rotate:'1'});
ok($('#transform').css('transform') === 'scaleX(3) rotate(1rad)' );
});
test("2 transform, 2 properties", function() {
$('#transform').css({translateX:100, scaleX:'1'});
ok($('#transform').css('transform') === 'translate(100px) scaleX(1)' );
});
test("1 matrix transform, 6 properties", function() {
$('#transform').css('martix','2,2,2,2,2,2');
ok($('#transform').css('transform') === 'matrix(2,2,2,2,2,2)' );
});
test("1 matrix, 1 transform, multiple properties", function() {
$('#transform').css({martix:'2,2,2,2,2,2', scale:1});
ok($('#transform').css('transform') === 'matrix(2,2,2,2,2,2) scale(1)' );
});
test("any transform as a number", function() {
$('#transform').css('translateX',30);
ok($('#transform').css('transform') === 'transformX(30px)' );
});
test("translate as non-pixel unit", function() {
$('#transform').css('translateX','3em');
ok($('#transform').css('transform') === 'transformX(3em)' );
});
test("angle as number", function() {
$('#transform').css('rotate',2);
ok($('#transform').css('transform') === 'rotate(2rad)' );
});
test("angle in degrees", function() {
$('#transform').css('rotate','360deg');
ok($('#transform').css('transform') === 'rotate(1rad)');
});
module("Parse Transform");
test("1 transform, 1 property", function() {
ok("all pass" );
});
test("1 transform, 2 properties", function() {
ok("all pass" );
});
test("2 transform, 1 property", function() {
ok("all pass" );
});
test("2 transform, 2 properties", function() {
ok("all pass" );
});
test("1 matrix transform, 6 properties", function() {
ok("all pass" );
});
test("1 matrix, 1 transform, multiple properties", function() {
ok("all pass" );
});
module("Transforms");
test("composite transform", function() {
});
test("independant transform", function() {
});
});
</script>
</head>
<body>
<h1 id="qunit-header">QTransform - CSS3 Transformations Unit Test</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<div id="qunit-fixture">
<div id='#transform'>
</div>
</body>
</html>