Skip to content

Commit

Permalink
Fixed bad typo in new implementation.
Browse files Browse the repository at this point in the history
Also edited test so that it catches bugs like that.
  • Loading branch information
Joscha Rohmann committed Oct 26, 2015
1 parent 1d48456 commit 3a00364
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/query/Expression.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ define([
}

if (nodeWise) {
value[expression.nodeLength - 1] = (value[expression.nodeLength] || '') + tempValue;
value[expression.nodeLength - 1] = (value[expression.nodeLength - 1] || '') + tempValue;
} else {
value += tempValue;
}
Expand Down
4 changes: 2 additions & 2 deletions test/spec/query/expressions.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@
it('updates the right node when called in reset()', function () {
var ul = document.getElementById('testElement').appendChild(document.createElement('div')).appendChild(document.createElement('ul'));
ul.setAttribute('data-query', 'each(updateTests)');
ul.innerHTML = '<li>\n{{$this.content}}</li>';
ul.innerHTML = '<li>\nsome none variable text{{$this.content}}!</li>';

var arr = blocks.observable([]);

Expand All @@ -462,7 +462,7 @@
content: blocks.observable('test')
}]);

expect(ul.innerHTML).toMatch(/<li data-id="\d+">[\n\s]*<!-- \d+:blocks -->[\n\s]*test[\n\s]*<\/li>/im);
expect(ul.innerHTML).toMatch(/<li data-id="\d+">[\n\s]+some none variable text<!-- \d+:blocks -->[\n\s]*test![\n\s]*<\/li>/im);
});

});
Expand Down

0 comments on commit 3a00364

Please sign in to comment.