You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
angular-contenteditable/test/e2e/scenarios.coffee

25 lines
1.2 KiB
CoffeeScript

describe 'module contenteditable', ->
describe 'directive contenteditable', ->
describe 'simple application', ->
beforeEach ->
browser().navigateTo 'base/test/fixtures/simple.html'
it 'should update the model from the view (simple text)', ->
element('#input').enter('abc')
expect(element('#input').html()).toBe 'abc'
expect(element('#output').html()).toBe 'abc'
it 'should update the model from the view (text with spans)', ->
element('#input').html('abc <span style="color:red">red</span>')
expect(element('#input span').html()).toBe 'red'
expect(element('#output').html()).toBe 'abc &lt;span style="color:red"&gt;red&lt;/span&gt;'
it 'should update the view from the model', ->
input('model').enter('oops')
expect(element('#input').html()).toBe 'oops'
expect(element('#output').html()).toBe 'oops'
input('model').enter('a <span style="color:red">red</span> b')
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'