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.
25 lines
1.2 KiB
CoffeeScript
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 <span style="color:red">red</span>'
|
|
|
|
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 <span style="color:red">red</span> b'
|