Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

123 lines (96 sloc) 3.676 kb
<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>
Jump to Line
Something went wrong with that request. Please try again.