-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #867: List: Don't call inherited destroy if useTouchScroll is false
- Loading branch information
Kenneth G. Franqueiro
committed
Mar 7, 2014
1 parent
e957549
commit bea918f
Showing
2 changed files
with
20 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,37 @@ | ||
define([ | ||
"intern!tdd", | ||
"intern/chai!assert", | ||
"dojo/_base/declare", | ||
"dgrid/List", | ||
"dgrid/Grid", | ||
"dgrid/editor", | ||
"dgrid/TouchScroll", | ||
"dijit/registry", | ||
"dijit/form/TextBox", | ||
"dgrid/test/data/base" | ||
], function (test, assert, List, Grid, editor, registry, TextBox) { | ||
], function (test, assert, declare, List, TouchScroll, registry, TextBox) { | ||
|
||
test.suite("createDestroy", function(){ | ||
// Tests | ||
test.test("no params list", function(){ | ||
// build a list, start it up, and render | ||
var list = new List(); | ||
document.body.appendChild(list.domNode); | ||
list.startup(); | ||
list.renderArray([ "foo", "bar", "baz" ]); | ||
|
||
// check number of children | ||
|
||
assert.strictEqual(list.contentNode.children.length, 3, | ||
"List's contentNode has expected number of children after renderArray"); | ||
|
||
// kill it & make sure we are all cleaned up | ||
|
||
list.destroy(); | ||
assert.notStrictEqual(document.body, list.parentNode, | ||
"List is removed from body after destroy"); | ||
}); | ||
|
||
test.test("TouchScroll with useTouchScroll: false", function(){ | ||
// Ensure TouchScroll is inherited for this test | ||
var list = new (declare([TouchScroll, List]))({ useTouchScroll: false }); | ||
|
||
// This should not cause an error | ||
assert.doesNotThrow(function(){ | ||
list.destroy(); | ||
}, null, 'destroy should not throw error'); | ||
}); | ||
}); | ||
}); |