Skip to content

Commit

Permalink
Ensure Marker#join returns a Marker with a builder
Browse files Browse the repository at this point in the history
  • Loading branch information
bantic committed Aug 11, 2015
1 parent 462d9a7 commit 19a30b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/models/marker.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const Marker = class Marker extends LinkedItem {
}

join(other) {
const joined = new Marker(this.value + other.value);
const joined = this.builder.createMarker(this.value + other.value);
this.markups.forEach(m => joined.addMarkup(m));
other.markups.forEach(m => joined.addMarkup(m));

Expand Down
1 change: 1 addition & 0 deletions tests/unit/models/marker-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ test('a marker can be joined to another', (assert) => {
m2.addMarkup(builder.createMarkup('i'));

const m3 = m1.join(m2);
assert.equal(m3.builder, builder, 'joined marker also has builder');
assert.equal(m3.value, 'hi there!');
assert.ok(m3.hasMarkup('b'));
assert.ok(m3.hasMarkup('i'));
Expand Down

0 comments on commit 19a30b3

Please sign in to comment.