Permalink
Browse files

Positionable + Tests

  • Loading branch information...
1 parent c3b2603 commit 958f392fa7c8cd4c9b19a7a742f9aa4fc12cfda0 @daffl daffl committed Aug 9, 2012
Showing with 55 additions and 10 deletions.
  1. +16 −0 positionable/funcunit.html
  2. +36 −0 positionable/positionable_test.js
  3. +1 −1 test/funcunit.html
  4. +2 −1 test/funcunit.js
  5. +0 −8 test/test.js
View
@@ -0,0 +1,16 @@
+<html>
+<head>
+ <link rel="stylesheet" type="text/css" href="../../funcunit/qunit/qunit.css"/>
+</head>
+ <body>
+ <h1 id="qunit-header">jQuery.fills Test Suite</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-test-area"></div>
+ <script type='text/javascript' src='../../steal/steal.js?canui/positionable/positionable_test.js'></script>
+ </body>
+</html>
@@ -0,0 +1,36 @@
+steal('funcunit').then(function(){
+
+module("can.ui.Positionable",{
+ setup: function(){
+ S.open("//canui/positionable/demos.html");
+ }
+});
+
+test("General positioning", function(){
+ S('.tooltip').invisible('Tooltip hidden');
+ S('a:first').click();
+ S('.tooltip').visible('Tooltip shows');
+ S('.tooltip').css('top', '30px', 'Top is set to 30px');
+});
+
+test("hideWhenInvisible", function(){
+ S('.tooltip').invisible('Tooltip hidden');
+ S('.scrollable a:first').click();
+ S('.tooltip').visible('Tooltip shows');
+ S('.scrollable').scroll('top', 20);
+ S('.tooltip').invisible('Tooltip hidden when scrolled');
+});
+
+test("Moving", function(){
+ S('.tooltip').invisible('Tooltip hidden');
+ S(function() {
+ S.win.$('.tooltip').on('move', function() {
+ ok('moved')
+ })
+ })
+ S('.scrollable a:eq(4)').click();
+ S('.tooltip').visible('Tooltip shows');
+ S('.scrollable').scroll('top', 60);
+});
+
+})
View
@@ -11,6 +11,6 @@ <h2 id="qunit-banner"></h2>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<div id="qunit-test-area"></div>
- <script type='text/javascript' src='../../steal/steal.js?canui/test'></script>
+ <script type='text/javascript' src='../../steal/steal.js?canui/test/funcunit.js'></script>
</body>
</html>
View
@@ -3,5 +3,6 @@ steal('funcunit',
'../table_scroll/table_scroll_test.js',
'../selectable/selectable_test.js',
'../split/split_test.js',
- '../resizable/resizable_test.js'
+ '../resizable/resizable_test.js',
+ '../positionable/positionable_test.js'
);
View
@@ -1,8 +0,0 @@
-steal('funcunit',
- '../fills/fills_test.js',
- '../table_scroll/table_scroll_test.js',
- '../selectable/selectable_test.js',
- '../split/split_test.js'
- // '../list/list_test.js'
- // '../grid/grid_test.js',
-);

0 comments on commit 958f392

Please sign in to comment.