Skip to content

Commit

Permalink
Fix tests: ensure assertions are checked after widget's refreshRender…
Browse files Browse the repository at this point in the history
…ing(), thus fixing errors on IE10; remove useless inherintance from delite/Widget in test container, now that Scrollable extends Widget.
  • Loading branch information
Adrian Vasiliu committed Jan 27, 2014
1 parent c221bcf commit 0602c3a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions tests/Scrollable-shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ define([
return {
"Default CSS" : function () {
var w = document.getElementById("sc1");
w.validateRendering();
assert.isTrue(domClass.contains(w, "test-scrollable-container"),
"Expecting test-scrollable-container CSS class! (id='sc1')");
assert.isTrue(domClass.contains(w, "d-scrollable"), // class added by the mixin delite/Scrollable
"Expecting d-scrollable CSS class! (id='sc1')");

w = document.getElementById("sc2"); // with scrollDirection == "none"
w.validateRendering();
assert.equal(w.scrollDirection, "none", "wrong scroll direction for id=sc2!");
assert.isTrue(domClass.contains(w, "test-scrollable-container"),
"Expecting test-scrollable-container CSS class! (id='sc2')");
Expand All @@ -24,6 +26,7 @@ define([
"Not expecting d-scrollable CSS class! (id='sc2')");

w = document.getElementById("mysc1");
w.validateRendering();
assert.isTrue(domClass.contains(w, "test-scrollable-container"),
"Expecting test-scrollable-container CSS class! (id='mysc1')");
assert.isTrue(domClass.contains(w, "d-scrollable"), // class added by the mixin delite/Scrollable
Expand All @@ -32,6 +35,7 @@ define([

"CSS class dependency on scrollDirection" : function () {
var w = document.getElementById("sc1");
w.validateRendering();
assert.isTrue(domClass.contains(w, "test-scrollable-container"),
"Expecting test-scrollable-container CSS class! (id='sc1')");
assert.isTrue(domClass.contains(w, "d-scrollable"), // class added by the mixin delite/Scrollable
Expand Down Expand Up @@ -77,6 +81,7 @@ define([

"scrollableNode" : function () {
var w = document.getElementById("sc1");
w.validateRendering();
assert.isTrue(w.scrollableNode === w, "Wrong scrollableNode!");
},

Expand Down
5 changes: 2 additions & 3 deletions tests/ScrollableTestContainer.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
define([
"delite/register",
"delite/Widget",
"delite/Container",
"delite/Scrollable"
], function (register, Widget, Container, Scrollable) {
], function (register, Container, Scrollable) {

// The purpose of this module is to provide a concrete widget using
// the mixin delite/Scrollable in order to ease the testing of the mixin itself.

return register("test-scrollable-container",
[HTMLElement, Widget, Container, Scrollable], {
[HTMLElement, Container, Scrollable], {
baseClass: "test-scrollable-container"
});
});

0 comments on commit 0602c3a

Please sign in to comment.