view-node-map-test.js revision 57ae29e469a05555e94fa1801b4a2aa13e9ad366
var ArrayAssert = Y.ArrayAssert,
ObjectAssert = Y.ObjectAssert,
name: 'General',
setUp: function () {
this.container = Y.Node.create('<div id="node-map-container"><div id="node-map-child"></div></div>');
},
tearDown: function () {
},
'getByNode() should return a View instance associated with the given Node': function () {
Assert.areSame(this.view, MappedView.getByNode(this.container), 'Node ref to the container should work.');
Assert.areSame(this.view, MappedView.getByNode('#node-map-container'), 'Id selector for the container should work.');
Assert.areSame(this.view, MappedView.getByNode('#node-map-child'), 'Id selector for a child of the container should work.');
},
'getByNode() should return the nearest View instance': function () {
},
'getByNode() should return null when no View is found': function () {
},
'View should be removed from the instances map when destroy() is called': function () {
ObjectAssert.ownsKey(key, Y.View.NodeMap._instances, 'Node stamp should exist in the instances map.');
Assert.isFalse(key in Y.View.NodeMap._instances, 'Node stamp should not exist in the instances map after the instance is destroyed.');
this.view = null;
}
}));
}, '@VERSION@', {
});