Icontem

File: test/test.js

Recommend this page to a friend!
  Classes of Emil Kilhage  >  jQuery Observe  >  test/test.js  >  Download  
File: test/test.js
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: jQuery Observe
Observe element changes and invoke callbacks
Author: By
Last change:
Date: 2 years ago
Size: 683 bytes
 

Contents

Class file image Download
test("simple input field", function(){
    
    stop();
  
    var input = $("<input type='text' value='0' />").observe(function() {
        ok(true);
    }).observe(function() {
        ok(true);
        start();
        
    }).get(0);
    
    setTimeout(function(){
        
        input.value += "1";
        
    }, 1);
    
});

test("simple plain object", function(){
    stop();
    
    var o = {};
    
    $(o).observe(function() {
        ok(true);
    }).observe(function() {
        ok(true);
    }).observe(function() {
        ok(true);
    }).observe(function() {
        ok(true);
        $(o).unobserve();
        start();
    });
    
    o.value = "dew";
});