Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8724

Show
Ignore:
Timestamp:
01/25/08 22:03:39 (2 years ago)
Author:
andrew
Message:

Add tests for Element#descendantOf that deal with dynamically-created elements. [Andrew Dupont]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • spinoffs/prototype/trunk/test/unit/dom.html

    r8723 r8724  
    11071107      assert(!$('child').descendantOf('not-in-the-family'), 'child < not-in-the-family'); 
    11081108       
    1109       assert(!$(document.body).descendantOf('great-grand-child'));       
     1109      assert(!$(document.body).descendantOf('great-grand-child')); 
     1110 
     1111      // dynamically-created elements 
     1112      $('ancestor').insert(new Element('div', { id: 'weird-uncle' })); 
     1113      assert($('weird-uncle').descendantOf('ancestor')); 
     1114       
     1115      $(document.body).insert(new Element('div', { id: 'impostor' })); 
     1116      assert(!$('impostor').descendantOf('ancestor')); 
    11101117    }},   
    11111118