Skip to content

Commit

Permalink
Additional tests for Element#makeClipping(), Element#undoClipping() -…
Browse files Browse the repository at this point in the history
… see ticket #1063
  • Loading branch information
Victor Homyakov committed Mar 6, 2012
1 parent c5e7547 commit a376792
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions test/unit/dom_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},

Expand Down

0 comments on commit a376792

Please sign in to comment.