mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Tests: Allow async domEqual() tests.
This commit is contained in:
parent
d657538ed5
commit
902df84fce
@ -271,11 +271,22 @@ window.domEqual = function( selector, modifier, message ) {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
expected = extract( $( selector ) );
|
||||
modifier( $( selector ) );
|
||||
|
||||
actual = extract( $( selector ) );
|
||||
QUnit.push( QUnit.equiv(actual, expected), actual, expected, message );
|
||||
function done() {
|
||||
actual = extract( $( selector ) );
|
||||
QUnit.push( QUnit.equiv(actual, expected), actual, expected, message );
|
||||
}
|
||||
|
||||
// Get current state prior to modifier
|
||||
expected = extract( $( selector ) );
|
||||
|
||||
// Run modifier (async or sync), then compare state via done()
|
||||
if ( modifier.length ) {
|
||||
modifier( done );
|
||||
} else {
|
||||
modifier();
|
||||
done();
|
||||
}
|
||||
};
|
||||
|
||||
}( jQuery ));
|
||||
|
Loading…
Reference in New Issue
Block a user