Skip to content

Commit

Permalink
Fix unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dumluregn committed Nov 19, 2019
1 parent d54aff3 commit b9e556e
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 148 deletions.
Original file line number Diff line number Diff line change
@@ -1,125 +1,5 @@
<textarea id="table-cell">
<p>[Start</p>
<table>
<tbody>
<tr>
<td>cell1</td>
<td>cell2</td>
</tr>
</tbody>
</table>
<p>End]</p>

=>
<table>
<tbody>
<tr>
<td>foo^</td>
</tr>
</tbody>
</table>
</textarea>

<span id="table-cell-paste">
<table>
<tr>
<td>foo</td>
</tr>
</table>
</span>

<textarea id="text">
<p>[Start</p>
<table>
<tbody>
<tr>
<td>cell1</td>
<td>cell2</td>
</tr>
</tbody>
</table>
<p>End]</p>

=>

<p>foo^</p>
</textarea>

<span id="text-paste">
<p>foo</p>
</span>

<textarea id="mixed-content">
<p>[Start</p>
<table>
<tbody>
<tr>
<td>cell1</td>
<td>cell2</td>
</tr>
</tbody>
</table>
<p>End]</p>

=>
<ul>
<li>
foo
</li>
<li>
bar
</li>
</ul>
<table>
<tbody>
<tr>
<td>foo^</td>
</tr>
</tbody>
</table>
</textarea>

<span id="mixed-content-paste">
<ul>
<li>
foo
</li>
<li>
bar
</li>
</ul>
<table>
<tr>
<td>foo</td>
</tr>
</table>
</span>

<tbody id="blockquote">
<p>[Start</p>

<blockquote>
<p><strong>Before</strong></p>

<table border="1">
<tbody>
<tr>
<td>co</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>

<p>After]</p>
</blockquote>

=>

<p>foo^</p>
</tbody>

<textarea id="nested-table">
<p>Start</p>

<blockquote>
<p><strong>Before</strong></p>
Expand All @@ -132,7 +12,7 @@
</tr>
<tr>
<td> </td>
<td><p>Start [nesting</p>
<td>Start nesting
<table border="1" cellpadding="1" cellspacing="1" style="width:100%">
<tbody>
<tr>
Expand All @@ -148,36 +28,71 @@
</tbody>
</table>

<p>End] nesting</p>
<p>End nesting</p>
</td>
</tr>
</tbody>
</table>

<p>After</p>
<p>After]</p>
</blockquote>

=>

<p>Start</p>
<p>foo^</p>
</textarea>

<textarea id="inside-blockquote">
<blockquote>
<p><strong>Before</strong></p>
<p><strong>from [here</strong></p>

<table border="1">
<tbody>
<tr>
<td>co</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
<p>up to here]. And more text</p>

<table border="1">
<tbody>
<tr>
<td><strong>First</strong></td>
<td>Second</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><p>Start foo^ nesting</p></td>
</tr>
</tbody>
</table>
</blockquote>

<p>After</p>
=>
<blockquote>
<p>
<strong>from </strong>foo^. and more text
</p>
</blockquote>

</textarea>

<textarea id="all-blockquote">
<blockquote>
<p><strong>[from here</strong></p>

<table border="1">
<tbody>
<tr>
<td>co</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
<p>up to here]</p>

</blockquote>

=>
<blockquote>
<p>
foo^
</p>
</blockquote>

</textarea>


<span id="text-paste">
<p>foo</p>
</span>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* bender-tags: tableselection, clipboard */
/* bender-ckeditor-plugins: undo,tableselection,list,blockquote */
/* bender-ckeditor-plugins: undo,tableselection,blockquote,divarea */
/* bender-include: ../../_helpers/tableselection.js */
/* global createPasteTestCase */

Expand All @@ -13,7 +13,6 @@
},
divarea: {
config: {
enterMode: CKEDITOR.ENTER_DIV,
extraPlugins: 'divarea'
}
}
Expand All @@ -24,16 +23,12 @@
bender.tools.ignoreUnsupportedEnvironment( 'tableselection' );
},

// (#875)
'test pasting table cell': createPasteTestCase( 'table-cell', 'table-cell-paste' ),
// // (#875)
'test pasting after selecting all': createPasteTestCase( 'text', 'text-paste' ),

'test pasting text': createPasteTestCase( 'text', 'text-paste' ),
'test pasting with part of blockquote selected': createPasteTestCase( 'inside-blockquote', 'text-paste' ),

'test pasting mixed-content': createPasteTestCase( 'mixed-content', 'mixed-content-paste' ),

'test pasting with blockquote': createPasteTestCase( 'blockquote', 'text-paste' ),

'test pasting around nested table': createPasteTestCase( 'nested-table', 'text-paste' )
'test pasting with whole blockquote selected': createPasteTestCase( 'all-blockquote', 'text-paste' )
};

tests = bender.tools.createTestsForEditors( CKEDITOR.tools.object.keys( bender.editors ), tests );
Expand Down

0 comments on commit b9e556e

Please sign in to comment.