Skip to content

Commit 3a00364

Browse files
author
Joscha Rohmann
committed
Fixed bad typo in new implementation.
Also edited test so that it catches bugs like that.
1 parent 1d48456 commit 3a00364

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/query/Expression.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ define([
111111
}
112112

113113
if (nodeWise) {
114-
value[expression.nodeLength - 1] = (value[expression.nodeLength] || '') + tempValue;
114+
value[expression.nodeLength - 1] = (value[expression.nodeLength - 1] || '') + tempValue;
115115
} else {
116116
value += tempValue;
117117
}

test/spec/query/expressions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@
445445
it('updates the right node when called in reset()', function () {
446446
var ul = document.getElementById('testElement').appendChild(document.createElement('div')).appendChild(document.createElement('ul'));
447447
ul.setAttribute('data-query', 'each(updateTests)');
448-
ul.innerHTML = '<li>\n{{$this.content}}</li>';
448+
ul.innerHTML = '<li>\nsome none variable text{{$this.content}}!</li>';
449449

450450
var arr = blocks.observable([]);
451451

@@ -462,7 +462,7 @@
462462
content: blocks.observable('test')
463463
}]);
464464

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

468468
});

0 commit comments

Comments
 (0)