mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Make sure that the correct context is being passed in for replaceWith(fn). Fixes #5798.
This commit is contained in:
@@ -720,6 +720,16 @@ test("replaceWith(String|Element|Array<Element>|jQuery)", function() {
|
||||
|
||||
test("replaceWith(Function)", function() {
|
||||
testReplaceWith(functionReturningObj);
|
||||
|
||||
expect(16);
|
||||
|
||||
var y = jQuery("#yahoo")[0];
|
||||
|
||||
jQuery(y).replaceWith(function(){
|
||||
equals( this, y, "Make sure the context is coming in correctly." );
|
||||
});
|
||||
|
||||
reset();
|
||||
})
|
||||
|
||||
test("replaceAll(String|Element|Array<Element>|jQuery)", function() {
|
||||
|
||||
Reference in New Issue
Block a user