Skip to content
This repository has been archived by the owner on Jan 7, 2020. It is now read-only.

Commit

Permalink
creating tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davidecavaliere committed Aug 24, 2015
1 parent 010411c commit 1dc63c7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/e2e/scenarios.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,12 @@ describe 'module contenteditable', ->
expect(element('#input').html()).toBe 'a <span style="color:red">red</span> b'
expect(element('#input span').html()).toBe 'red'
expect(element('#output').html()).toBe 'a &lt;span style="color:red"&gt;red&lt;/span&gt; b'

it 'setting the model with some pure text should dispaly <br> instead of newlines \\n', ->
input('unformatted').enter('#h1\n\n##h2\n###h3');
expect(element('#output-unformatted').html()).toBe '#h1<br><br>##h2<br>###h3'

it 'putting some unformatted text with <br>s in the html should replace them with newlines', ->

element('#output-unformatted').html('#h1<br><br>##h2<br>###h3');
expect(input('unformatted').val()).toBe('#h1\n\n##h2\n###h3');
5 changes: 5 additions & 0 deletions test/fixtures/simple.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
<hr>
<label>Contenteditable without Model</label>
<div contenteditable>Edit me - I don't affect anything</div>
<hr>
<label>Model has pure text</label>
<br>
<textarea id="input-unformatted" ng-model="unformatted"></textarea>
<div id="output-unformatted" contenteditable="true" ng-model="unformatted" unformatted-text="true"></div>
</div>
</body>
</html>

0 comments on commit 1dc63c7

Please sign in to comment.