Skip to content

Commit

Permalink
use .toMatch to catch optional linebreak
Browse files Browse the repository at this point in the history
  • Loading branch information
nchase committed Dec 19, 2017
1 parent 358fcd9 commit 52defad
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions spec/content.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -649,8 +649,7 @@ describe('Content TestCase', function () {
fireEvent(target, 'keydown', {
keyCode: MediumEditor.util.keyCode.BACKSPACE
});
this.el.innerHTML = stripLinebreak(this.el);
expect(this.el.innerHTML).toBe('<p>lorem ipsum</p><ul><li></li><li>lorem ipsum</li></ul>');
expect(this.el.innerHTML).toMatch(/^<p>lorem ipsum<\/p><ul><li>(<br>)?<\/li><li>lorem ipsum<\/li><\/ul>$/);
});
});

Expand Down Expand Up @@ -812,7 +811,3 @@ describe('Content TestCase', function () {
});
});
});

function stripLinebreak(element) {
return element.innerHTML.replace('<br>', '');
}

0 comments on commit 52defad

Please sign in to comment.