From dec2804c783003c13d356ed3fec664c3ac4b05ee Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Fri, 17 Feb 2012 14:17:20 -0500 Subject: Fix #11359: preserve contents for cloned scripts --- test/unit/manipulation.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test') diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index 49402b8a3..21d1f5f93 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -1169,6 +1169,15 @@ test("clone()", function() { equal( jQuery("body").clone().children()[0].id, "qunit-header", "Make sure cloning body works" ); }); +test("clone(script type=non-javascript) (#11359)", function() { + expect(3); + var src = jQuery(""); + var dest = src.clone(); + equal( dest[0].text, "Lorem ipsum dolor sit amet", "Cloning preserves script text" ); + equal( dest.last().html(), src.last().html(), "Cloning preserves nested script text" ); + ok( /^\s*consectetur adipiscing elit<\/scr.pt>\s*$/i.test( dest.last().html() ), "Cloning preserves nested script text" ); +}); + test("clone(form element) (Bug #3879, #6655)", function() { expect(5); var element = jQuery(""); -- cgit v1.2.3