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

Commit

Permalink
Minor code style improvements in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
oskarwrobel committed Sep 16, 2019
1 parent dce5c7b commit 78f6c76
Showing 1 changed file with 24 additions and 26 deletions.
50 changes: 24 additions & 26 deletions tests/todolistediting.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,26 @@ describe( 'TodoListEditing', () => {
expect( getViewData( view ) ).to.equal( '<test class="checked">{}Foo</test>' );
} );

it( 'should move selection after checkmark element to the first text node', () => {
setModelData( model, '<listItem listType="todo" listIndent="0">Foo</listItem>' );

expect( getViewData( view ) ).to.equal(
'<ul class="todo-list">' +
'<li><label class="todo-list__checkmark" contenteditable="false"></label>{}Foo</li>' +
'</ul>'
);
} );

it( 'should move selection after checkmark element when list item does not contain any text node', () => {
setModelData( model, '<listItem listType="todo" listIndent="0">[]</listItem>' );

expect( getViewData( view ) ).to.equal(
'<ul class="todo-list">' +
'<li><label class="todo-list__checkmark" contenteditable="false"></label>[]</li>' +
'</ul>'
);
} );

it( 'should properly handle typing inside text node with attribute', () => {
setModelData( model, '<listItem listType="todo" listIndent="0"><$text bold="true">[]foo</$text></listItem>' );

Expand All @@ -424,8 +444,8 @@ describe( 'TodoListEditing', () => {
expect( getViewData( view ) ).to.equal(
'<ul class="todo-list">' +
'<li>' +
'<label class="todo-list__checkmark" contenteditable="false"></label>' +
'<strong>b{}foo</strong>' +
'<label class="todo-list__checkmark" contenteditable="false"></label>' +
'<strong>b{}foo</strong>' +
'</li>' +
'</ul>'
);
Expand All @@ -445,8 +465,8 @@ describe( 'TodoListEditing', () => {
expect( getViewData( view ) ).to.equal(
'<ul class="todo-list">' +
'<li>' +
'<label class="todo-list__checkmark" contenteditable="false"></label>' +
'<a href="foo"><strong>b{}foo</strong></a>' +
'<label class="todo-list__checkmark" contenteditable="false"></label>' +
'<a href="foo"><strong>b{}foo</strong></a>' +
'</li>' +
'</ul>'
);
Expand Down Expand Up @@ -775,28 +795,6 @@ describe( 'TodoListEditing', () => {
} );
} );

describe( 'selection view post-fixer', () => {
it( 'should move selection after checkmark element to the first text node', () => {
setModelData( model, '<listItem listType="todo" listIndent="0">Foo</listItem>' );

expect( getViewData( view ) ).to.equal(
'<ul class="todo-list">' +
'<li><label class="todo-list__checkmark" contenteditable="false"></label>{}Foo</li>' +
'</ul>'
);
} );

it( 'should move selection after checkmark element when list item does not contain any text node', () => {
setModelData( model, '<listItem listType="todo" listIndent="0">[]</listItem>' );

expect( getViewData( view ) ).to.equal(
'<ul class="todo-list">' +
'<li><label class="todo-list__checkmark" contenteditable="false"></label>[]</li>' +
'</ul>'
);
} );
} );

describe( 'uiElements view post-fixer', () => {
it( 'should move all UIElements from before a checkmark after the checkmark element', () => {
setModelData( model,
Expand Down

0 comments on commit 78f6c76

Please sign in to comment.