Created
December 8, 2011 19:21
-
-
Save manko/1448145 to your computer and use it in GitHub Desktop.
Unit test for SC2 single-runloop append/remove problem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test("the DOM element is gone after doing append and remove in two separate runloops", function() { | |
| var view = SC.View.create(); | |
| SC.run(function() { | |
| view.append(); | |
| }); | |
| SC.run(function() { | |
| view.remove(); | |
| }); | |
| var viewElem = SC.$('#'+get(view, 'elementId')); | |
| ok(viewElem.length === 0, "view's element doesn't exist in DOM"); | |
| }); | |
| test("the DOM element is gone after doing append and remove in a single runloop", function() { | |
| var view = SC.View.create(); | |
| SC.run(function() { | |
| view.append(); | |
| view.remove(); | |
| }); | |
| var viewElem = SC.$('#'+get(view, 'elementId')); | |
| ok(viewElem.length === 0, "view's element doesn't exist in DOM"); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment