Permalink
Browse files

upgraydedd tests

  • Loading branch information...
1 parent 34a9779 commit 8d8bda2ddd30cbedd181b96320e30c5f4a5b0b77 @kamicane committed Apr 5, 2012
Showing with 48 additions and 44 deletions.
  1. +2 −1 .gitignore
  2. +2 −1 .npmignore
  3. +41 −40 test/index.html
  4. +1 −0 test/test.accessor.js
  5. +2 −2 test/test.parsers.js
View
@@ -1,3 +1,4 @@
*.html
node_modules
-.tm_properties
+.tm_properties
+test.js
View
@@ -8,4 +8,5 @@ test/*
README.*
moofx.js
moofx-min.js
-.tm_properties
+.tm_properties
+test.js
View
@@ -1,49 +1,50 @@
<html>
<head>
- <meta charset="utf-8">
- <title>Mocha Tests</title>
- <link rel="stylesheet" href="https://raw.github.com/visionmedia/mocha/master/mocha.css" />
- <script src="https://raw.github.com/LearnBoost/expect.js/d2440da086bf8dc38c6085641f23b968a0f48b29/expect.js"></script>
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
- <script src="https://raw.github.com/visionmedia/mocha/master/mocha.js"></script>
-
- <script>
- mocha.setup('bdd')
- $(function(){mocha.run()})
- </script>
-
- <script type="text/javascript" src="../moofx.js"></script>
-
- <script src="test.parsers.js"></script>
- <script src="test.frame.js"></script>
- <script src="test.accessor.js"></script>
-
- <style type="text/css">
- #test {
- width: 100px;
- height: 100px;
- visibility: 'hidden';
- position: absolute;
- top: -1000px;
- left: -1000px;
- opacity: 0.5;
- filter: alpha(opacity=50);
- }
+ <meta charset="utf-8">
+ <title>Mocha Tests</title>
+ <link rel="stylesheet" href="https://raw.github.com/visionmedia/mocha/master/mocha.css" />
+ <script src="https://raw.github.com/LearnBoost/expect.js/d2440da086bf8dc38c6085641f23b968a0f48b29/expect.js"></script>
+ <script src="https://raw.github.com/visionmedia/mocha/master/mocha.js"></script>
- #testee {
- background-color: black;
- width: 100%;
- height: 100%;
- padding: 10%;
- margin: 0;
- border: 2px dotted red;
- }
- </style>
+ <script>
+ mocha.setup('bdd')
+ window.onload = function(){
+ mocha.run()
+ }
+ </script>
+
+ <script type="text/javascript" src="../moofx.js"></script>
+
+ <script src="test.parsers.js"></script>
+ <script src="test.frame.js"></script>
+ <script src="test.accessor.js"></script>
+
+ <style type="text/css">
+ #test {
+ width: 100px;
+ height: 100px;
+ visibility: 'hidden';
+ position: absolute;
+ top: -1000px;
+ left: -1000px;
+ opacity: 0.5;
+ filter: alpha(opacity=50);
+ }
+
+ #testee {
+ background-color: black;
+ width: 100%;
+ height: 100%;
+ padding: 10%;
+ margin: 0;
+ border: 2px dotted red;
+ }
+ </style>
</head>
<div id="test">
- <div id="testee">some text</div>
+ <div id="testee">some text</div>
</div>
<body>
- <div id="mocha"></div>
+ <div id="mocha"></div>
</body>
</html>
View
@@ -61,6 +61,7 @@ describe('computes', function (){
})
it('should set/overwrite the opacity', function(){
+ expect(test.compute('opacity')).to.be("0.5")
test.style('opacity', 1)
expect(test.compute('opacity')).to.be("1")
test.style('opacity', null)
View
@@ -75,7 +75,7 @@ describe('CSS Parsers', function (){
expect(moofx.parse('color', "10%")).to.be("")
expect(moofx.parse('color', "#000")).to.be("rgb(0,0,0)")
- expect(moofx.parse('color', "#0000")).to.be("rgba(0,0,0,0)")
+ expect(moofx.parse('color', "#0000")).to.be("transparent")
expect(moofx.parse('color', "#000f")).to.be("rgb(0,0,0)")
expect(moofx.parse('color', "rgb(0, 0, 0, 0.5)")).to.be("rgba(0,0,0,0.5)")
expect(moofx.parse('color', "rgba(0, 0, 0, 1)")).to.be("rgb(0,0,0)")
@@ -127,7 +127,7 @@ describe('CSS Parsers', function (){
expect(moofx.parse('border', "1px dashed green")).to.be("1px dashed rgb(0,128,0)")
expect(moofx.parse('border', "1px none red")).to.be("1px none rgb(255,0,0)")
- expect(moofx.parse('border', "0 double #0000")).to.be("0px double rgba(0,0,0,0)")
+ expect(moofx.parse('border', "0 double #0000")).to.be("0px double transparent")
expect(moofx.parse('border', "10% double rgba(0,0,0,0)", true, testee)).to.be("10px double rgba(0,0,0,0)")
expect(moofx.parse('border', "", true)).to.be("0px none rgba(0,0,0,1)")

0 comments on commit 8d8bda2

Please sign in to comment.