Skip to content

Commit

Permalink
Replace tree_expand_hidden.html with Intern unit test
Browse files Browse the repository at this point in the history
This tests expansion of a parent row in a tree grid when it is not in
document flow.  Prior to 0.3.1, the children would expand but be rendered
with 0 height in browsers supporting CSS transitions.
  • Loading branch information
msssk authored and Kenneth G. Franqueiro committed Mar 31, 2014
1 parent f94da89 commit ac51700
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 67 deletions.
6 changes: 0 additions & 6 deletions test/data/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -315,12 +315,6 @@
"title": "Test Tree Grid",
"parent": ""
},
{
"name": "tree_expand_hidden.html",
"url": "tree_expand_hidden.html",
"title": "Test Tree Grid Expanding while Hidden",
"parent": ""
},
{
"name": "tundra_custom.html",
"url": "tundra_custom.html",
Expand Down
17 changes: 16 additions & 1 deletion test/intern/plugins/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,22 @@ define([
testRowExists("4:99");
});
});

test.test("expand hidden", function() {
var dfd = this.async(1000);

grid.domNode.style.display = "none";
grid.expand(0);
grid.domNode.style.display = "block";

// Since the grid is not displayed the expansion will occur without a transitionend event
// However, DOM updates from the expand will not complete within the current stack frame
setTimeout(dfd.callback(function() {
var connected = grid.row(0).element.connected;
assert.isTrue(connected && connected.offsetHeight > 0,
"Node should be expanded with non-zero height");
}), 0);
});
});

test.suite("tree + observable", function(){
Expand All @@ -201,6 +217,5 @@ define([
});
});
});

});
});
60 changes: 0 additions & 60 deletions test/tree_expand_hidden.html

This file was deleted.

0 comments on commit ac51700

Please sign in to comment.