| Testing basic View operations: root view access, view creation, and subview management. |
| |
| |
| == Running test suite: View.Basics |
| -- Running test case: View.rootView |
| PASS: Root view should be attached by definition. |
| PASS: Root view element should be document.body. |
| PASS: Root view should not have a pending layout. |
| PASS: Root view should not have subviews. |
| PASS: View.rootView() should always return the same view. |
| |
| -- Running test case: View.constructor |
| PASS: View should not be attached. |
| PASS: View element should be a <div>. |
| PASS: View element should not have child nodes. |
| PASS: View should not have a pending layout. |
| PASS: View should not have subviews. |
| PASS: View should not have a parent. |
| PASS: View should be created with passed in element. |
| |
| -- Running test case: View.addSubview |
| PASS: Child should have the correct parent. |
| PASS: Child should be a descendant of the parent. |
| PASS: Child should be included in the parent's subviews. |
| PASS: Adding a view multiple times should have no effect. |
| PASS: Grandchild should be a descendant of it's grandparent. |
| |
| -- Running test case: View.removeSubview |
| PASS: Removed view should not have a parent. |
| PASS: Removed view should not be a descendant of the parent. |
| PASS: Removed view should not be included in the parent's subviews. |
| PASS: Removing a nonexistent view should have no effect. |
| |
| -- Running test case: View.removeSubview.IndirectDescendant |
| PASS: Removed view should not be in the DOM. |
| |
| -- Running test case: View.insertSubviewBefore |
| PASS: Inserting a view before `null` should append the view. |
| PASS: child2 should be inserted before dhild1. |
| PASS: child1 should be after child2. |
| PASS: Inserting a view before a nonexistent view should have no effect. |
| |
| -- Running test case: View.replaceSubview |
| PASS: Replaced view should not have a parent. |
| PASS: New view should have the correct parent. |
| PASS: Replacing a view with itself should have no effect. |
| PASS: Replacing a nonexistent view should have no effect. |
| |
| -- Running test case: View.isAttached |
| PASS: View added to the root should be attached. |
| PASS: View removed from the root should not be attached. |
| PASS: View added to a detached parent should not be attached. |
| PASS: Attaching a view to the root causes descendent views to be attached. |
| PASS: Detaching a view from the root causes descendent views to be detached. |
| |
| -- Running test case: View.fromElement |
| PASS: Should be able to lookup an existing view from its element. |
| PASS: Should return null for an element not associated with any view. |
| PASS: Should return null for non-element. |
| PASS: Should return null for null element. |
| |