Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Additional tests for Element#makeClipping(), Element#undoClipping() -…

… see ticket #1063
  • Loading branch information...
commit a3767925dbfb608dd084c1e6637b1fd6acae9a63 1 parent c5e7547
Victor Homyakov authored
Showing with 15 additions and 5 deletions.
  1. +15 −5 test/unit/dom_test.js
20 test/unit/dom_test.js
View
@@ -676,14 +676,24 @@ new Test.Unit.Runner({
this.assertEqual(chained, chained.undoClipping());
this.assertEqual(chained, chained.undoClipping().makeClipping());
- ['hidden','visible','scroll'].each( function(overflowValue) {
- var element = $('element_with_'+overflowValue+'_overflow');
-
- this.assertEqual(overflowValue, element.getStyle('overflow'));
+ var items = [
+ {id: 'hidden', inline: 'hidden', computed: 'hidden'},
+ {id: 'visible', inline: 'visible', computed: 'visible'},
+ {id: 'scroll', inline: 'scroll', computed: 'scroll'},
+ {id: 'auto', inline: 'auto', computed: null},
+ {id: 'empty', inline: '', computed: 'visible'}
+ ];
+
+ items.each(function(item) {
+ var element = $('element_with_' + item.id + '_overflow');
+ this.assertEqual(item.inline, element.style.overflow, 'inline style');
+ this.assertEqual(item.computed, element.getStyle('overflow'), 'computed style');
element.makeClipping();
+ this.assertEqual('hidden', element.style.overflow);
this.assertEqual('hidden', element.getStyle('overflow'));
element.undoClipping();
- this.assertEqual(overflowValue, element.getStyle('overflow'));
+ this.assertEqual(item.inline, element.style.overflow, 'restored inline style');
+ this.assertEqual(item.computed, element.getStyle('overflow'), 'restored computed style');
}, this);
},
Please sign in to comment.
Something went wrong with that request. Please try again.